From 9350b9aa7bddd55c0857b3adeec0dfb8900f149c Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Sun, 13 May 2018 10:36:58 -0400 Subject: mconf: Take only one optional builddir arg that defaults to '.' --- mesonbuild/mconf.py | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'mesonbuild/mconf.py') diff --git a/mesonbuild/mconf.py b/mesonbuild/mconf.py index c4d4bb4..513c238 100644 --- a/mesonbuild/mconf.py +++ b/mesonbuild/mconf.py @@ -21,7 +21,7 @@ def buildparser(): parser = argparse.ArgumentParser(prog='meson configure') coredata.register_builtin_arguments(parser) - parser.add_argument('directory', nargs='*') + parser.add_argument('builddir', nargs='?', default='.') parser.add_argument('--clearcache', action='store_true', default=False, help='Clear cached state (e.g. found dependencies)') return parser @@ -152,18 +152,9 @@ class Conf: def run(args): args = mesonlib.expand_arguments(args) - if not args: - args = [os.getcwd()] options = buildparser().parse_args(args) coredata.parse_cmd_line_options(options) - if len(options.directory) > 1: - print('%s ' % args[0]) - print('If you omit the build directory, the current directory is substituted.') - return 1 - if not options.directory: - builddir = os.getcwd() - else: - builddir = options.directory[0] + builddir = os.path.abspath(os.path.realpath(options.builddir)) try: c = Conf(builddir) save = False -- cgit v1.1