Parag Gupta 3bc5914676 shell-completion: zsh: complete options for systemctl show
zsh only ever offered unit names after `systemctl show`, since
_systemctl_show() was sharing the same completion function as
is-active/status/preset/etc., none of which recognize `-`-prefixed
words at all. This meant `systemctl show --<TAB>` and
`systemctl show --property <TAB>` produced no completions, even
though the same options complete fine before the subcommand word
(bash has always completed both cases correctly).

Give `show` its own completion function that first tries the
existing global option specs (now pulled out into a `_sys_arguments`
array so they can be reused) via _arguments, falling back to unit
name completion for everything else. The unit-name fallback is
factored into a shared _systemctl_non_template_units() helper so it
isn't duplicated between _systemctl_show() and the existing
NONTEMPLATE_UNITS loop.

While doing so, fix pre-existing bugs in that option list which this
change makes newly reachable (and, for the filters below, newly
relevant) after `show`:

- `-P` was documented as a bare `--privileged[Acquire privileges
  before execution]` flag, which systemctl does not have. `-P NAME`
  is actually short-only and equivalent to `--value --property=NAME`
  (src/systemctl/systemctl.c); it now completes property names the
  same way `-p`/`--property` do, and is grouped next to them instead
  of sitting in `--privileged`'s old, unrelated slot.
- `-p`/`--property`, `-t`/`--type`, and `--state` all lacked the `*`
  repeatability prefix, so completion stopped offering each after its
  first use even though systemctl accumulates all three
  (parse_property_argument()/parse_types_argument()/
  parse_states_argument(), all via strv_consume()). `_loginctl`
  already uses the correct `'*'{-p+,--property=}...` form for -p.
  -t/--type and --state are both documented as filters that apply to
  `show` specifically (man/systemctl.xml), same as -p/--property.
- `--value`, documented specifically for `show` ("When showing
  properties, only print the value"), was missing from the zsh
  completion entirely, though bash already completes it.
- `-M`/`--machine=` (OPTION_COMMON_MACHINE) was likewise missing,
  despite directly affecting `show`'s bus transport the same way the
  already-present `-H`/`--host` does; `_loginctl`/`_busctl` already
  have the matching `_sd_machines`-backed spec.

Also switch both `_arguments` call sites to splice `_sys_arguments`
as `"$_sys_arguments[@]"` rather than bare, matching the prevailing
quoted-array idiom used by five other completions in this directory
(_systemd-hwdb, _userdbctl, _systemd-id128, _updatectl,
_systemd-sysupdate) and avoiding the unquoted form's behavior of
silently eliding any element that becomes empty.

Fixes #37463
2026-08-25 10:22:01 +01:00
2022-04-26 09:13:57 +00:00
2026-08-16 03:01:28 +09:00
…
2026-07-08 08:23:04 +02:00
2026-04-18 14:24:47 +01:00
2025-06-05 14:39:20 +02:00
2026-03-06 08:55:55 +01:00
2025-10-07 13:00:12 +01:00
2026-08-23 14:10:22 +01:00
2026-07-28 19:46:34 +09:00
2026-08-24 11:56:27 +02:00

Systemd

System and Service Manager

OBS Packages Status
Semaphore CI 2.0 Build Status
Coverity Scan Status
OSS-Fuzz Status
CIFuzz
CII Best Practices
Fossies codespell report
Translation status
Coverage Status
Packaging status
OpenSSF Scorecard

Details

Most documentation is available on systemd's website.

Assorted, older, general information about systemd can be found in the systemd Wiki.

Information about build requirements is provided in the README file.

Consult our NEWS file for information about what's new in the most recent systemd versions.

Please see the Code Map for information about this repository's layout and content.

Please see the Hacking guide for information on how to hack on systemd and test your modifications.

Please see our Contribution Guidelines for more information about filing GitHub Issues and posting GitHub Pull Requests.

When preparing patches for systemd, please follow our Coding Style Guidelines.

If you are looking for support, please contact our mailing list, join our IRC channel #systemd on libera.chat or Matrix channel

Stable branches with backported patches are available in the stable repo.

We have a security bug bounty program sponsored by the Sovereign Tech Fund hosted on YesWeHack

Repositories with distribution packages built from git main are available on OBS, and also repositories with packages built from the latest stable release

S
Description
systemd patched fork
Readme Cite this repository
409 MiB
Languages
C 88.5%
Shell 5.7%
Python 4.6%
Meson 1.1%