Make "meson help" and "meson help <subcommand>" do the expected thing.

pull/3189/head
Jukka Laurila 7 years ago committed by Jussi Pakkanen
parent fa1401bec1
commit 048508c989
  1. 6
      docs/markdown/snippets/improved-help.md
  2. 7
      mesonbuild/mesonmain.py

@ -0,0 +1,6 @@
## "meson help" now shows command line help
Command line parsing is now less surprising. "meson help" is now
equivalent to "meson --help" and "meson help <subcommand>" is
equivalent to "meson <subcommand> --help", instead of creating a build
directory called "help" in these cases.

@ -284,6 +284,13 @@ def run(original_args, mainfile=None):
# First check if we want to run a subcommand.
cmd_name = args[0]
remaining_args = args[1:]
# "help" is a special case: Since printing of the help may be
# delegated to a subcommand, we edit cmd_name before executing
# the rest of the logic here.
if cmd_name == 'help':
remaining_args += ['--help']
args = remaining_args
cmd_name = args[0]
if cmd_name == 'test':
return mtest.run(remaining_args)
elif cmd_name == 'setup':

Loading…
Cancel
Save