Ævar Arnfjörð Bjarmason <avarab@xxxxxxxxx> writes: > As preceding commits have incrementally established all of the --all, > --guides, --config and hidden --config-for-completion options are > mutually exclusive. So let's use OPT_CMDMODE() to parse the > command-line instead, and take advantage of its conflicting options > detection. Sounds quite logical. > I think this makes the usage information that we emit slightly worse, > e.g. before we'd emit: > > $ git help --all --config > fatal: --config and --all cannot be combined > > usage: git help [-a|--all] [--[no-]verbose]] > [[-i|--info] [-m|--man] [-w|--web]] [<command>] > or: git help [-g|--guides] > or: git help [-c|--config] > [...] > $ > > And now: > > $ git help --all --config > error: option `config' is incompatible with --all > $ We often hear that our error messages for command line options are unhelpful by being too broad, don't we? I think the new one would be much better by not scrolling away the most important part. Those who want to know about options other than --all and --config can issue "git help -h" after seeing that single line error, but not everybody has to do so. > But improving that is a general topic for parse-options.c improvement, > i.e. we should probably emit the full usage in that case. Yes, absolutely.