From: Luca Boccassi Date: Tue, 16 Aug 2022 22:04:40 +0000 (+0100) Subject: bash-completion: autocomplete cgroup names in systemd-cgtop X-Git-Tag: v252-rc1~418 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0a152619aca5b6c16d022cc3e6ab2fc3786d0284;p=thirdparty%2Fsystemd.git bash-completion: autocomplete cgroup names in systemd-cgtop --- diff --git a/shell-completion/bash/systemd-cgtop b/shell-completion/bash/systemd-cgtop index c9092600980..ca0a51e9490 100644 --- a/shell-completion/bash/systemd-cgtop +++ b/shell-completion/bash/systemd-cgtop @@ -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