mirror of
https://github.com/systemd/systemd
synced 2024-10-15 12:34:37 +00:00
systemctl: add -P as short for --value --property=
This commit is contained in:
parent
6829d8ce69
commit
5292c24047
|
@ -1502,6 +1502,17 @@ Jan 12 10:46:45 example.com bluetoothd[8900]: gatt-time-server: Input/output err
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term><option>-P</option></term>
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<para>Equivalent to <option>--value</option> <option>--property=</option>, i.e. shows the
|
||||||
|
value of the property without the property name or <literal>=</literal>. Note that using
|
||||||
|
<option>-P</option> once will also affect all properties listed with
|
||||||
|
<option>-p</option>/<option>--property=</option>.</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><option>-a</option></term>
|
<term><option>-a</option></term>
|
||||||
<term><option>--all</option></term>
|
<term><option>--all</option></term>
|
||||||
|
@ -1627,9 +1638,8 @@ Jan 12 10:46:45 example.com bluetoothd[8900]: gatt-time-server: Input/output err
|
||||||
<term><option>--value</option></term>
|
<term><option>--value</option></term>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>When printing properties with <command>show</command>,
|
<para>When printing properties with <command>show</command>, only print the value, and skip the
|
||||||
only print the value, and skip the property name and
|
property name and <literal>=</literal>. Also see option <option>-P</option> above.</para>
|
||||||
<literal>=</literal>.</para>
|
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
|
|
|
@ -7966,6 +7966,7 @@ static int systemctl_help(void) {
|
||||||
" --state=STATE List units with particular LOAD or SUB or ACTIVE state\n"
|
" --state=STATE List units with particular LOAD or SUB or ACTIVE state\n"
|
||||||
" --failed Shorcut for --state=failed\n"
|
" --failed Shorcut for --state=failed\n"
|
||||||
" -p --property=NAME Show only properties by this name\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"
|
" -a --all Show all properties/all units currently in memory,\n"
|
||||||
" including dead/empty ones. To list all units installed\n"
|
" including dead/empty ones. To list all units installed\n"
|
||||||
" on the system, use 'list-unit-files' instead.\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) */
|
/* we default to allowing interactive authorization only in systemctl (not in the legacy commands) */
|
||||||
arg_ask_password = true;
|
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) {
|
switch (c) {
|
||||||
|
|
||||||
|
@ -8389,6 +8390,10 @@ static int systemctl_parse_argv(int argc, char *argv[]) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case 'P':
|
||||||
|
arg_value = true;
|
||||||
|
_fallthrough_;
|
||||||
|
|
||||||
case 'p':
|
case 'p':
|
||||||
/* Make sure that if the empty property list was specified, we won't show any
|
/* Make sure that if the empty property list was specified, we won't show any
|
||||||
properties. */
|
properties. */
|
||||||
|
@ -8413,9 +8418,7 @@ static int systemctl_parse_argv(int argc, char *argv[]) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If the user asked for a particular
|
/* If the user asked for a particular property, show it, even if it is empty. */
|
||||||
* property, show it to him, even if it is
|
|
||||||
* empty. */
|
|
||||||
arg_all = true;
|
arg_all = true;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue