mirror of
https://github.com/systemd/systemd
synced 2024-07-21 10:17:21 +00:00
zsh: _filter_units_by_property: respect --user
Use `$_sys_service_mgr` to handle `--user`, so that `systemctl --user stop` will correctly filter the active (user) units. Before this patch, only user units that also exist as system units and are stoppable there would be listed.
This commit is contained in:
parent
29df65f913
commit
56ef545c24
|
@ -126,7 +126,7 @@ _filter_units_by_property() {
|
|||
local property=$1 value=$2 ; shift ; shift
|
||||
local -a units ; units=($*)
|
||||
local props
|
||||
for props in ${(ps:\n\n:)"$(_call_program units "$service show --no-pager --property="Id,$property" -- ${units} 2>/dev/null")"}; do
|
||||
for props in ${(ps:\n\n:)"$(_call_program units "$service $_sys_service_mgr show --no-pager --property="Id,$property" -- ${units} 2>/dev/null")"}; do
|
||||
props=(${(f)props})
|
||||
if [[ "${props[2]}" = "$property=$value" ]]; then
|
||||
echo -E - " ${props[1]#Id=}"
|
||||
|
|
Loading…
Reference in a new issue