aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/mconf.py
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2018-05-13 10:36:58 -0400
committerNirbheek Chauhan <nirbheek.chauhan@gmail.com>2018-06-06 20:02:37 +0000
commit9350b9aa7bddd55c0857b3adeec0dfb8900f149c (patch)
treeea3e46d725e523c6293463aedd575b3587c4592b /mesonbuild/mconf.py
parent6ed7a314028b8ad399de1c3443b8a3fceb10f360 (diff)
downloadmeson-9350b9aa7bddd55c0857b3adeec0dfb8900f149c.zip
meson-9350b9aa7bddd55c0857b3adeec0dfb8900f149c.tar.gz
meson-9350b9aa7bddd55c0857b3adeec0dfb8900f149c.tar.bz2
mconf: Take only one optional builddir arg that defaults to '.'
Diffstat (limited to 'mesonbuild/mconf.py')
-rw-r--r--mesonbuild/mconf.py13
1 files changed, 2 insertions, 11 deletions
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 <build directory>' % 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