diff options
Diffstat (limited to 'shell-completion')
-rw-r--r-- | shell-completion/bash/journalctl | 16 | ||||
-rw-r--r-- | shell-completion/bash/machinectl | 2 | ||||
-rw-r--r-- | shell-completion/zsh/_machinectl | 1 |
3 files changed, 5 insertions, 14 deletions
diff --git a/shell-completion/bash/journalctl b/shell-completion/bash/journalctl index 7c8a9ce361..53bedcd92e 100644 --- a/shell-completion/bash/journalctl +++ b/shell-completion/bash/journalctl @@ -30,17 +30,6 @@ __get_machines() { { while read a b; do echo " $a"; done; } | sort -u; } -__journal_fields=(MESSAGE{,_ID} PRIORITY CODE_{FILE,LINE,FUNC} - ERRNO SYSLOG_{FACILITY,IDENTIFIER,PID} COREDUMP_EXE - _{P,U,G}ID _COMM _EXE _CMDLINE - _CAP_EFFECTIVE _AUDIT_{SESSION,LOGINUID} - _SYSTEMD_{CGROUP,SESSION,{,USER_}UNIT,OWNER_UID,SLICE} - _SELINUX_CONTEXT _SOURCE_REALTIME_TIMESTAMP - _{BOOT,MACHINE}_ID _HOSTNAME _TRANSPORT - _KERNEL_{DEVICE,SUBSYSTEM} - _UDEV_{SYSNAME,DEVNODE,DEVLINK} - __CURSOR __{REALTIME,MONOTONIC}_TIMESTAMP) - __syslog_priorities=(emerg alert crit err warning notice info debug) _journalctl() { @@ -79,7 +68,7 @@ _journalctl() { comps='short short-iso short-precise short-monotonic verbose export json json-pretty json-sse cat' ;; --field|-F) - comps=${__journal_fields[*]} + comps=$(journalctl --fields | sort 2>/dev/null) ;; --machine|-M) comps=$( __get_machines ) @@ -125,8 +114,9 @@ _journalctl() { mapfile -t field_vals < <(journalctl -F "${COMP_WORDS[COMP_CWORD-2]}" 2>/dev/null) COMPREPLY=( $(compgen -W '${field_vals[*]}' -- "$cur") ) else + mapfile -t field_vals < <(journalctl --fields 2>/dev/null) compopt -o nospace - COMPREPLY=( $(compgen -W '${__journal_fields[*]}' -S= -- "$cur") ) + COMPREPLY=( $(compgen -W '${field_vals[*]}' -S= -- "$cur") ) fi } diff --git a/shell-completion/bash/machinectl b/shell-completion/bash/machinectl index e7829ca968..aebe48304d 100644 --- a/shell-completion/bash/machinectl +++ b/shell-completion/bash/machinectl @@ -41,7 +41,7 @@ _machinectl() { local -A VERBS=( [STANDALONE]='list list-images pull-tar pull-raw import-tar import-raw export-tar export-raw list-transfers cancel-transfer' - [MACHINES]='status show start login shell enable disable poweroff reboot terminate kill copy-to copy-from image-status show-image clone rename read-only remove set-limit' + [MACHINES]='status show start stop login shell enable disable poweroff reboot terminate kill copy-to copy-from image-status show-image clone rename read-only remove set-limit' ) _init_completion || return diff --git a/shell-completion/zsh/_machinectl b/shell-completion/zsh/_machinectl index 198fa28f7b..92d77109a5 100644 --- a/shell-completion/zsh/_machinectl +++ b/shell-completion/zsh/_machinectl @@ -23,6 +23,7 @@ _available_machines() { "status:Show VM/container status" "show:Show properties of one or more VMs/containers" "start:Start container as a service" + "stop:Stop container (equal to poweroff)" "login:Get a login prompt on a VM/container" "enable:Enable automatic container start at boot" "disable:Disable automatic container start at boot" |