Our --help handling is convoluted and confusing, since we're hacking
around using some of argparse's built-in features (like generating
--help arguments for us). It seems like we were hacking around the
conflict between -h used for hashes and -h used for automatic help
flags. Fortunately, Python's argparse provides us with a
'conflict_handler' which will resolve these conflicts for us.
Altogether, this patch means that 'pwclient --help' will not generate a
full recursive print of all subcommand helps (arguably a good thing),
but it provides better automatic formatting of all the supported
subcommands and eliminates some awkward code.
optional arguments:
-h, --help show this help message and exit
Commands:
{apply,git-am,get,info,projects,states,view,update,list,search}
apply Apply a patch (in the current dir, using -p1)
git-am Apply a patch to current git branch using "git am".
get Download a patch and save it locally
info Display patchwork info about a given patch ID
projects List all projects
states Show list of potential patch states
view View a patch
update Update patch
list List patches, using the optional filters specified
below and an optional substring to search for patches
by name
search Alias for "list"
Use 'pwclient <command> --help' for more info
$ pwclient info --help
usage: pwclient info [--help] [-h HASH] [-p PROJECT] [ID [ID ...]]
positional arguments:
ID Patch ID
optional arguments:
--help show this help message and exit
-h HASH Lookup by patch hash
-p PROJECT Lookup patch in project
Signed-off-by: Brian Norris <computersforpeace@gmail.com> Acked-by: Mike Frysinger <vapier@chromium.org> Reviewed-by: Stephen Finucane <stephen.finucane@intel.com>