From 0a152619aca5b6c16d022cc3e6ab2fc3786d0284 Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Tue, 16 Aug 2022 23:04:40 +0100 Subject: [PATCH] bash-completion: autocomplete cgroup names in systemd-cgtop --- shell-completion/bash/systemd-cgtop | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/shell-completion/bash/systemd-cgtop b/shell-completion/bash/systemd-cgtop index c909260098..ca0a51e949 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 -- 2.25.1