To skip the annoying part, and get to the good stuff.
Gives a simple CLI interface, and a helper function to perform command line commands from within your application
For the best experience, install "just" and "Ninja".
Boilerplate to add a executable target and use Google Test to set up a unit test target.
A class which is meant to be subclassed from.
The entrypoint which should not be overridden is run(...). It will parse input args and then send them to dispatch(...). dispatch(...) will either go into REPL mode if the app is called with no arguments. Otherwise, it simply passes the command to one of three functions meant to be overridden:
- handle_command(...): Should handle most commands
- show_help(...): Show something helpful
- show_version(...): Show the app version
Likely, the show_version(...) function will never really need to be overridden.
Simple class that only contains two fields for configuring the shell and shell args to make it flexible, have a function for live changing of those variables and finally a run command to run the commands.
Example usage is cmdRunner.run_command("cat ~/.bashrc") > returns a std::string with that file's content.
A command handler file, for the app "just".
Allows you to do
- just clean
- just build
- just rebuild
- just run
and you could of course always add more. Just a convenient tool.