I'm writing a little command line todo app that has a general git-like interface.
It has several tasks it can perform: add
, list
, complete
, ... all of these should be accessible via the todo <task>
interface. Eg todo list
.
Like with git, some of these task take variables or options, and the todo
app can also take options (which are applicable to any type of task, e.g. the location of the config file).
Eventually one should be able to write something like:
todo -c ~/.config/todorc add --desc "walk the dog"
Note the order of things here: the global options are given (and can only be given) before the actual task. The skeleton for a typical call is then:
todo [global options] <task> [task options/arguments]
I'm writing this project in C++ and the basic backend library is finished. I'm trying to figure out how to write the user interface now.
Should I use one big main
that handles every task separatly or should I split up the program into several subprograms and call them from a simple shell script (which is what git does if I'm correct). The latter seems easier to maintain, but makes it harder to pass on the global options to the task executable.
Is there any literature on this subject?