summaryrefslogtreecommitdiffstats
path: root/src/systemctl
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2020-04-01 18:29:00 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2020-04-03 18:24:20 +0200
commit5292c240471b8622067963e6f57b1faf0376fb01 (patch)
treefa15e9881387a6fcf0eee0ee92d33563205cd5b9 /src/systemctl
parentMerge pull request #15253 from DaanDeMeyer/object-vtable-error-docs (diff)
downloadsystemd-5292c240471b8622067963e6f57b1faf0376fb01.tar.xz
systemd-5292c240471b8622067963e6f57b1faf0376fb01.zip
systemctl: add -P as short for --value --property=
Diffstat (limited to 'src/systemctl')
-rw-r--r--src/systemctl/systemctl.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index 58b0fd3688..dcd93fce17 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -7966,6 +7966,7 @@ static int systemctl_help(void) {
" --state=STATE List units with particular LOAD or SUB or ACTIVE state\n"
" --failed Shorcut for --state=failed\n"
" -p --property=NAME Show only properties by this name\n"
+ " -P NAME Equivalent to --value --property=NAME\n"
" -a --all Show all properties/all units currently in memory,\n"
" including dead/empty ones. To list all units installed\n"
" on the system, use 'list-unit-files' instead.\n"
@@ -8334,7 +8335,7 @@ static int systemctl_parse_argv(int argc, char *argv[]) {
/* we default to allowing interactive authorization only in systemctl (not in the legacy commands) */
arg_ask_password = true;
- while ((c = getopt_long(argc, argv, "ht:p:alqfs:H:M:n:o:iTr.::", options, NULL)) >= 0)
+ while ((c = getopt_long(argc, argv, "ht:p:P:alqfs:H:M:n:o:iTr.::", options, NULL)) >= 0)
switch (c) {
@@ -8389,6 +8390,10 @@ static int systemctl_parse_argv(int argc, char *argv[]) {
break;
}
+ case 'P':
+ arg_value = true;
+ _fallthrough_;
+
case 'p':
/* Make sure that if the empty property list was specified, we won't show any
properties. */
@@ -8413,9 +8418,7 @@ static int systemctl_parse_argv(int argc, char *argv[]) {
}
}
- /* If the user asked for a particular
- * property, show it to him, even if it is
- * empty. */
+ /* If the user asked for a particular property, show it, even if it is empty. */
arg_all = true;
break;