Indent flag only toggles

pull/4547/head
Daniel Mensinger 6 years ago
parent 428f85e860
commit bcb8146280
No known key found for this signature in database
GPG Key ID: 54DD94C131E277D4
  1. 3
      docs/markdown/snippets/introspect_multiple.md
  2. 6
      mesonbuild/mintro.py

@ -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:

@ -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)

Loading…
Cancel
Save