shared/options: add OPTION_COMMON_LOWERCASE_J

This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2026-03-26 23:39:28 +01:00
parent 5e4003cd87
commit 1682845008
2 changed files with 4 additions and 2 deletions
+1 -2
View File
@@ -259,8 +259,7 @@ static int parse_argv(int argc, char *argv[], char ***ret_args) {
return r;
break;
OPTION_SHORT('j', NULL,
"Equivalent to --json=pretty (on TTY) or --json=short (otherwise)"):
OPTION_COMMON_LOWERCASE_J:
arg_json_format_flags = SD_JSON_FORMAT_PRETTY_AUTO|SD_JSON_FORMAT_COLOR_AUTO;
break;
+3
View File
@@ -68,6 +68,9 @@ typedef struct Option {
OPTION('M', "machine", "CONTAINER", "Operate on local container")
#define OPTION_COMMON_JSON \
OPTION_LONG("json", "FORMAT", "Generate JSON output (pretty, short, or off)")
#define OPTION_COMMON_LOWERCASE_J \
OPTION_SHORT('j', NULL, \
"Equivalent to --json=pretty (on TTY) or --json=short (otherwise)")
/* This is magically mapped to the beginning and end of the section */
extern const Option __start_SYSTEMD_OPTIONS[];