1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-03-08 20:58:20 +03:00

bash-completion: autocomplete cgroup names in systemd-cgtop

(cherry picked from commit 0a152619aca5b6c16d022cc3e6ab2fc3786d0284)
This commit is contained in:
Luca Boccassi 2022-08-16 23:04:40 +01:00 committed by Zbigniew Jędrzejewski-Szmek
parent 9f2f391153
commit 5219a99ccb

View File

@ -56,6 +56,11 @@ _systemd_cgtop() {
fi
COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "$cur") )
if [ -d /sys/fs/cgroup/systemd/ ]; then
COMPREPLY+=( $(cd /sys/fs/cgroup/systemd/ && compgen -o nospace -o dirnames "$cur") )
elif [ -d /sys/fs/cgroup/ ]; then
COMPREPLY+=( $(cd /sys/fs/cgroup/ && compgen -o nospace -o dirnames "$cur") )
fi
}
complete -F _systemd_cgtop systemd-cgtop