I'm building a GUI for a CL program and I have the following question
Is it better to
- Have the GUI invoke the program behind the scenes using a shell with some options eg: If I were I were writing a git frontend, I would just have every button click correspond to a
git foo barcommand that runs in its own shell
- Or by-pass the program's CLI and plug in directly to the layer underneath
Caveat: I did not build the the app in question,but I do have access to the source. I'm asking if both are acceptable development patterns and what are some things I should be aware of when choosing either?
I understand that programming to the CLI provides a static non changing interface to which I can program to and the innards can change as long as the interface remains the same, but wouldn't hooking directly into the code below the CLI allow for greater scope of debugging and richer error messages?