systemd-analyze: added the verb unit-shell to spawn and attach shell

This commit is contained in:
ZIHCO
2025-06-13 19:38:55 +01:00
committed by Luca Boccassi
parent 8a1d134144
commit 9a08000d18
7 changed files with 258 additions and 2 deletions

View File

@@ -82,6 +82,7 @@ _systemd_analyze() {
[FDSTORE]='fdstore'
[CAPABILITY]='capability'
[TRANSIENT_SETTINGS]='transient-settings'
[UNIT_SHELL]='unit-shell'
)
local CONFIGS='locale.conf systemd/bootchart.conf systemd/coredump.conf systemd/journald.conf
@@ -233,6 +234,13 @@ _systemd_analyze() {
else
comps="$(systemctl --no-legend --no-pager -t help)"
fi
elif __contains_word "$verb" ${VERBS[UNIT_SHELL]}; then
if [[ $cur = -* ]]; then
comps='--help --version'
else
comps=$( __get_services $mode )
fi
fi
COMPREPLY=( $(compgen -W '$comps' -- "$cur") )