aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
diff options
context:
space:
mode:
authorDaniel Mensinger <daniel@mensinger-ka.de>2018-11-26 18:58:03 +0100
committerDaniel Mensinger <daniel@mensinger-ka.de>2019-01-06 12:15:10 +0100
commita6034d1f198cd08a48026d2478c4e4539a3d9b36 (patch)
treefd045024237f2b7dc87b7a003c4e0e3ed80379c7 /mesonbuild
parent8288555aa1dcab1ae38831d40529c6a2fbe3c8fd (diff)
downloadmeson-a6034d1f198cd08a48026d2478c4e4539a3d9b36.zip
meson-a6034d1f198cd08a48026d2478c4e4539a3d9b36.tar.gz
meson-a6034d1f198cd08a48026d2478c4e4539a3d9b36.tar.bz2
Added option to force use the new format
Diffstat (limited to 'mesonbuild')
-rw-r--r--mesonbuild/mintro.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/mesonbuild/mintro.py b/mesonbuild/mintro.py
index 70f0f09..8d106c9 100644
--- a/mesonbuild/mintro.py
+++ b/mesonbuild/mintro.py
@@ -61,6 +61,8 @@ def add_arguments(parser):
help='Print all available information.')
parser.add_argument('-i', '--indent', dest='indent', type=int, default=0,
help='Number of spaces used for indentation.')
+ parser.add_argument('-f', '--force-new', action='store_true', dest='force_new', default=False,
+ help='Always use the new JSON format for multiple entries (even for 0 and 1 introspection commands)')
parser.add_argument('builddir', nargs='?', default='.', help='The build directory')
def determine_installed_path(target, installdata):
@@ -620,10 +622,10 @@ def run(options):
indent = options.indent if options.indent > 0 else None
- if len(results) == 0:
+ if len(results) == 0 and not options.force_new:
print('No command specified')
return 1
- elif len(results) == 1:
+ elif len(results) == 1 and not options.force_new:
# Make to keep the existing output format for a single option
print(json.dumps(results[0][1], indent=indent))
else: