diff --git a/man/systemd-analyze.xml b/man/systemd-analyze.xml index fb95a3ec53..927748bdc5 100644 --- a/man/systemd-analyze.xml +++ b/man/systemd-analyze.xml @@ -464,7 +464,7 @@ $ eog targets.svg <command>systemd-analyze exit-status <optional><replaceable>STATUS</replaceable>...</optional></command> This command prints a list of exit statuses along with their "class", i.e. the source of the - definition (one of glibc, systemd, LSB, or + definition (one of libc, systemd, LSB, or BSD), see the Process Exit Codes section in systemd.exec5. If no additional arguments are specified, all known statuses are shown. Otherwise, only the @@ -475,8 +475,8 @@ $ eog targets.svg $ systemd-analyze exit-status 0 1 {63..65} NAME STATUS CLASS -SUCCESS 0 glibc -FAILURE 1 glibc +SUCCESS 0 libc +FAILURE 1 libc - 63 - USAGE 64 BSD DATAERR 65 BSD diff --git a/shell-completion/bash/systemd-analyze b/shell-completion/bash/systemd-analyze index 8d05544941..a863af7aff 100644 --- a/shell-completion/bash/systemd-analyze +++ b/shell-completion/bash/systemd-analyze @@ -56,6 +56,15 @@ __get_architectures() { systemd-analyze --no-legend --no-pager architectures 2>/dev/null | { while read -r a b; do echo " $a"; done; } } +__get_filesystem_sets() { + local line + systemd-analyze filesystems --no-pager 2>/dev/null | while IFS= read -r line; do + if [[ $line == @* ]]; then + printf '%s\n' "$line" + fi + done +} + _systemd_analyze() { local i verb comps mode local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]} words cword @@ -68,7 +77,7 @@ _systemd_analyze() { ) local -A VERBS=( - [STANDALONE]='time blame unit-files unit-paths exit-status compare-versions calendar timestamp timespan pcrs nvpcrs srk has-tpm2 smbios11 chid image-policy' + [STANDALONE]='time blame unit-files unit-paths exit-status compare-versions timestamp timespan pcrs nvpcrs srk has-tpm2 smbios11 chid image-policy' [CRITICAL_CHAIN]='critical-chain' [DOT]='dot' [DUMP]='dump' @@ -86,6 +95,8 @@ _systemd_analyze() { [TRANSIENT_SETTINGS]='transient-settings' [UNIT_SHELL]='unit-shell' [UNIT_GDB]='unit-gdb' + [FILESYSTEMS]='filesystems' + [CALENDAR]='calendar' ) local CONFIGS='locale.conf systemd/bootchart.conf systemd/coredump.conf systemd/journald.conf @@ -265,6 +276,18 @@ _systemd_analyze() { else comps=$( __get_services $mode ) fi + + elif __contains_word "$verb" ${VERBS[FILESYSTEMS]}; then + if [[ $cur = -* ]]; then + comps='--help --version --no-pager' + else + comps=$( __get_filesystem_sets ) + fi + + elif __contains_word "$verb" ${VERBS[CALENDAR]}; then + if [[ $cur = -* ]]; then + comps='--help --version --iterations --base-time' + fi fi COMPREPLY=( $(compgen -W '$comps' -- "$cur") )