So what if we do it this way: there is a set of "global" options
(--debug, --help, etc.) that are compatible with every sub-command.
Each command also accepts other options. These options are globally
unique and can occur anywhere on the command line, but if used with
the wrong sub-command will give some sort of error.
So, in rough mockup (man, it's a lot easier doing mockups for command
line programs than for GUIs...):
$ monotone --help
Usage: monotone [OPTION...] command [ARGS...]
Global options:
--debug print debug log to stderr while running
--dump=STRING file to dump debugging log to, on failure
--quiet suppress log and progress messages
--help display help message
--nostd do not load standard lua hooks
--norc do not load ~/.monotonerc or MT/monotonerc lua
files
--rcfile=STRING load extra rc file
--key=STRING set key for signatures
--db=STRING set name of database
--branch=STRING select branch cert for operation
--version print version number, then exit
--full-version print detailed version number, then exit
--ticker=STRING set ticker style (count|dot) [count]
Command-specific options:
--revision=STRING select revision id for operation (diff, cdiff)
--message=STRING set commit changelog message (commit)
<list of commands>
$ monotone commit --help
Usage: monotone [OPTION...] command [ARGS...]
Global options:
<...>
Options for 'commit':
--message=STRING set commit changelog message
<description of commit command, as per now>
$ monotone commit --message=foo
<commits>
$ monotone --message=foo commit
<commits>
$ monotone --message=foo diff
monotone: misuse: 'diff' does not take option '--message'
Lots of things could be tweaked about this, but how does that sound as
a general approach?