commit 5d5aeb2f99410bd71904f92bf21fba7abf4ea284
Author: Sean Perry <email address hidden>
Date: Mon Jul 13 09:00:28 2015 -0700
Allow subcommands to accept --help when using 'deferred_help'.
This patch changes how cliff handles help for subcommands but only when
'deferred_help' is enabled. Currently cliff consumes --help requests at the top
level. This means `myapp foo --help` and `myapp --help` produce the same output.
To get help for `foo` one must use `myapp help foo`. With this change
`myapp foo --help` will produce the same output as `myapp help foo` by
transforming the --help request into a help subcommand one. This is only done
when there are any options on the command line other than --help. When a top
level --help is requested the original behavior of print_help_if_requested()
is preserved.
Reviewed: https:/ /review. openstack. org/201258 /git.openstack. org/cgit/ openstack/ cliff/commit/ ?id=5d5aeb2f994 10bd71904f92bf2 1fba7abf4ea284
Committed: https:/
Submitter: Jenkins
Branch: master
commit 5d5aeb2f99410bd 71904f92bf21fba 7abf4ea284
Author: Sean Perry <email address hidden>
Date: Mon Jul 13 09:00:28 2015 -0700
Allow subcommands to accept --help when using 'deferred_help'.
This patch changes how cliff handles help for subcommands but only when if_requested( )
'deferred_help' is enabled. Currently cliff consumes --help requests at the top
level. This means `myapp foo --help` and `myapp --help` produce the same output.
To get help for `foo` one must use `myapp help foo`. With this change
`myapp foo --help` will produce the same output as `myapp help foo` by
transforming the --help request into a help subcommand one. This is only done
when there are any options on the command line other than --help. When a top
level --help is requested the original behavior of print_help_
is preserved.
Change-Id: I628bbfc383de51 6045288512cc023 213d723a027
Closes-Bug: 1444983