loginctl: add -P as short for --value --property=

This commit is contained in:
Ronan Pigott 2020-09-29 23:51:08 -07:00 committed by Zbigniew Jędrzejewski-Szmek
parent bbbfe49b5e
commit 60b254ca1a
1 changed files with 6 additions and 1 deletions

View File

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