diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2016-01-16 23:04:41 +0200 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2016-01-16 23:04:41 +0200 |
commit | eda57f887a0cd62d29c0b9fa938a831ff7ba7307 (patch) | |
tree | 22e69abdab0fdc1cde5262aae3b53ec7a035d993 /mesonbuild/mesonmain.py | |
parent | 84456537da9a77bbfe4fe9027c9fb36111c6b38d (diff) | |
download | meson-eda57f887a0cd62d29c0b9fa938a831ff7ba7307.zip meson-eda57f887a0cd62d29c0b9fa938a831ff7ba7307.tar.gz meson-eda57f887a0cd62d29c0b9fa938a831ff7ba7307.tar.bz2 |
Improve command line arg behaviour.
Diffstat (limited to 'mesonbuild/mesonmain.py')
-rw-r--r-- | mesonbuild/mesonmain.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/mesonbuild/mesonmain.py b/mesonbuild/mesonmain.py index 7b0834c..6317c95 100644 --- a/mesonbuild/mesonmain.py +++ b/mesonbuild/mesonmain.py @@ -209,7 +209,7 @@ def run(mainfile, args): print('You have python %s.' % sys.version) print('Please update your environment') return 1 - if args[0] == '--internal': + if len(args) >= 2 and args[0] == '--internal': if args[1] != 'regenerate': sys.exit(run_script_command(args[1:])) args = args[2:] @@ -217,16 +217,15 @@ def run(mainfile, args): else: handshake = False args = mesonlib.expand_arguments(args) - if not args: - return 1 options = parser.parse_args(args) if options.print_version: print(coredata.version) return 0 args = options.directories if len(args) == 0 or len(args) > 2: - print('%s <source directory> <build directory>' % sys.argv[0]) + print('{} <source directory> <build directory>'.format(sys.argv[0])) print('If you omit either directory, the current directory is substituted.') + print('Run {} --help for more information.'.format(sys.argv[0])) return 1 dir1 = args[0] if len(args) > 1: |