bash-completion: autocomplete cgroup names in systemd-cgtop

This commit is contained in:
Luca Boccassi
2022-08-18 12:58:12 +01:00
committed by Luca Boccassi
parent 5ad8116a87
commit 0a152619ac
+5
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