aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Mensinger <daniel@mensinger-ka.de>2019-01-02 21:58:04 +0100
committerDaniel Mensinger <daniel@mensinger-ka.de>2019-01-06 12:19:35 +0100
commitbcb8146280ed89d1fabc3136e2e65a6173b31214 (patch)
tree1bb145ca2a55d6e3ad892fefa2d54d087c285515
parent428f85e8605034e30f835542f2d26600e967f4f0 (diff)
downloadmeson-bcb8146280ed89d1fabc3136e2e65a6173b31214.zip
meson-bcb8146280ed89d1fabc3136e2e65a6173b31214.tar.gz
meson-bcb8146280ed89d1fabc3136e2e65a6173b31214.tar.bz2
Indent flag only toggles
-rw-r--r--docs/markdown/snippets/introspect_multiple.md3
-rw-r--r--mesonbuild/mintro.py6
2 files changed, 5 insertions, 4 deletions
diff --git a/docs/markdown/snippets/introspect_multiple.md b/docs/markdown/snippets/introspect_multiple.md
index 0d53d48..131bf58 100644
--- a/docs/markdown/snippets/introspect_multiple.md
+++ b/docs/markdown/snippets/introspect_multiple.md
@@ -13,7 +13,8 @@ JSON output (the default is still compact JSON) and force use the new
output format, even if only one introspection command was given.
A complete introspection dump is also stored in the `meson-info`
-directory. This dump will be (re)generated each time meson updates the configuration of the build directory.
+directory. This dump will be (re)generated each time meson updates the
+configuration of the build directory.
Additionlly the format of `meson introspect target` was changed:
diff --git a/mesonbuild/mintro.py b/mesonbuild/mintro.py
index c0cefdb..3382e0d 100644
--- a/mesonbuild/mintro.py
+++ b/mesonbuild/mintro.py
@@ -56,8 +56,8 @@ def add_arguments(parser):
help='The backend to use for the --buildoptions introspection.')
parser.add_argument('-a', '--all', action='store_true', dest='all', default=False,
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('-i', '--indent', action='store_true', dest='indent', default=False,
+ help='Enable pretty printed JSON.')
parser.add_argument('-f', '--force-object-output', action='store_true', dest='force_dict', 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')
@@ -457,7 +457,7 @@ def list_projinfo_from_source(sourcedir, indent):
def run(options):
datadir = 'meson-private'
infodir = 'meson-info'
- indent = options.indent if options.indent > 0 else None
+ indent = 4 if options.indent else None
if options.builddir is not None:
datadir = os.path.join(options.builddir, datadir)
infodir = os.path.join(options.builddir, infodir)