Commit Graph
2 Commits
Author SHA1 Message Date
Damien Lespiau b157544394 Bump license copyright year to 2017 (#3132) 2017-10-03 14:52:03 +01:00
Damien Lespiau 3df1a0943c Make help instantaneous in the weave script
There are 3 ways to get help:

  • weave --help
  • weave help
  • weave <command> --help

At the moment, only the first one prints the usage instantaneously, the
others go much further in the script and take quite some time, which is
not idea of impatient users.

Note that "help" only works because it's not a recognized command and
ends up in the default case of "case $COMMAND" (and indeed, "Unknown
weave command 'help'" is displayed). This is because handle_help_arg()
always returns true and so the second part of:

  handle_help_arg "$1" || handle_help_arg "--$1"

is never evaluated.

This commit changes things a bit so all 3 ways to get help are
recognized early, print the usage and exit.
2017-07-11 16:46:42 +01:00