From: Ronan Pigott Date: Wed, 30 Sep 2020 06:51:08 +0000 (-0700) Subject: loginctl: add -P as short for --value --property= X-Git-Tag: v247-rc1~149 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=60b254ca1a4ac81b71dd5de8c396c663bafa64a7;p=thirdparty%2Fsystemd.git loginctl: add -P as short for --value --property= --- diff --git a/src/login/loginctl.c b/src/login/loginctl.c index bc4f25f41e8..053bb601a23 100644 --- a/src/login/loginctl.c +++ b/src/login/loginctl.c @@ -1266,6 +1266,7 @@ static int help(int argc, char *argv[], void *userdata) { " -H --host=[USER@]HOST Operate on remote host\n" " -M --machine=CONTAINER Operate on local container\n" " -p --property=NAME Show only properties by this name\n" + " -P NAME Equivalent to --value --property=NAME\n" " -a --all Show all properties, including empty ones\n" " --value When showing properties, only print the value\n" " -l --full Do not ellipsize output\n" @@ -1321,7 +1322,7 @@ static int parse_argv(int argc, char *argv[]) { assert(argc >= 0); assert(argv); - while ((c = getopt_long(argc, argv, "hp:als:H:M:n:o:", options, NULL)) >= 0) + while ((c = getopt_long(argc, argv, "hp:P:als:H:M:n:o:", options, NULL)) >= 0) switch (c) { @@ -1331,6 +1332,10 @@ static int parse_argv(int argc, char *argv[]) { case ARG_VERSION: return version(); + case 'P': + arg_value = true; + _fallthrough_; + case 'p': { r = strv_extend(&arg_property, optarg); if (r < 0)