/
niceSOFT
/
util-linux
Обзор
Документация
Войти
/
niceSOFT
/
util-linux
Код
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
v2.41
bash-completion/ipcrm
80 строк
2 KB
Prasanna Paithankar
sys-utils: warns if mqueue fs is not mounted
03 фев 2025, 16:07
03 фев 2025, 16:07
64ae7b7
Код
Авторство
О чём код?
_ipcrm_module() { local cur prev OPTS KEYIDS COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-m'|'--shmem-id') KEYIDS="$(lsipc -m --noheadings -o ID)" COMPREPLY=( $(compgen -W "$KEYIDS" -- $cur) ) return 0 ;; '-M'|'--shmem-key') KEYIDS="$(lsipc -m --noheadings -o KEY)" COMPREPLY=( $(compgen -W "$KEYIDS" -- $cur) ) return 0 ;; '--posix-shmem') KEYIDS="$(lsipc -M --noheadings -o NAME)" COMPREPLY=( $(compgen -W "$KEYIDS" -- $cur) ) return 0 ;; '-q'|'--queue-id') KEYIDS="$(lsipc -q --noheadings -o ID)" COMPREPLY=( $(compgen -W "$KEYIDS" -- $cur) ) return 0 ;; '-Q'|'--queue-key') KEYIDS="$(lsipc -q --noheadings -o KEY)" COMPREPLY=( $(compgen -W "$KEYIDS" -- $cur) ) return 0 ;; '--posix-mqueue') KEYIDS="$(lsipc -Q --noheadings -o NAME)" COMPREPLY=( $(compgen -W "$KEYIDS" -- $cur) ) return 0 ;; '-s'|'--semaphore-id') KEYIDS="$(lsipc -s --noheadings -o ID)" COMPREPLY=( $(compgen -W "$KEYIDS" -- $cur) ) return 0 ;; '-S'|'--semaphore-key') KEYIDS="$(lsipc -s --noheadings -o KEY)" COMPREPLY=( $(compgen -W "$KEYIDS" -- $cur) ) return 0 ;; '--posix-semaphore') KEYIDS="$(lsipc -S --noheadings -o NAME)" COMPREPLY=( $(compgen -W "$KEYIDS" -- $cur) ) return 0 ;; '-h'|'--help'|'-V'|'--version') return 0 ;; esac case $cur in '=') cur=${cur#=} COMPREPLY=( $(compgen -W "shm pshm msg pmsg sem psem" -- $cur) ) return 0 ;; esac OPTS=" --shmem-id --shmem-key --posix-shmem --queue-id --queue-key --posix-mqueue --semaphore-id --semaphore-key --posix-semaphore --all= --verbose --help --version" COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 } complete -F _ipcrm_module ipcrm