<xi:include href="standard-options.xml" xpointer="help" />
<xi:include href="standard-options.xml" xpointer="version" />
<xi:include href="standard-options.xml" xpointer="json" />
+ <xi:include href="standard-options.xml" xpointer="j" />
</variablelist>
</refsect1>
local i verb comps
local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]}
local -A OPTS=(
- [STANDALONE]='-h --help --version --transient --static --pretty --no-ask-password'
+ [STANDALONE]='-h --help --version --transient --static --pretty --no-ask-password -j'
[ARG]='-H --host -M --machine --json'
)
" --pretty Only set pretty hostname\n"
" --json=pretty|short|off\n"
" Generate JSON output\n"
+ " -j Same as --json=pretty on tty, --json=short otherwise\n"
"\nSee the %s for details.\n",
program_invocation_short_name,
ansi_highlight(),
assert(argc >= 0);
assert(argv);
- while ((c = getopt_long(argc, argv, "hH:M:", options, NULL)) >= 0)
+ while ((c = getopt_long(argc, argv, "hH:M:j", options, NULL)) >= 0)
switch (c) {
break;
+ case 'j':
+ arg_json_format_flags = JSON_FORMAT_PRETTY_AUTO|JSON_FORMAT_COLOR_AUTO;
+ break;
+
case '?':
return -EINVAL;