diff options
| author | Prasanna Paithankar <paithankarprasanna@gmail.com> | 2025-02-02 23:37:44 +0530 |
|---|---|---|
| committer | Prasanna Paithankar <paithankarprasanna@gmail.com> | 2025-02-02 23:37:44 +0530 |
| commit | 0f5e95f22866619c61eed8549c71accc8ab24beb (patch) | |
| tree | fdc49350856171fc4c356ae7f3d18563aec0ea17 /bash-completion | |
| parent | 27704d22e5c235019e02233803c1cbda1e2467ac (diff) | |
| download | util-linux-0f5e95f22866619c61eed8549c71accc8ab24beb.tar.gz | |
bash completions for IPC tools
Signed-off-by: Prasanna Paithankar <paithankarprasanna@gmail.com>
Diffstat (limited to 'bash-completion')
| -rw-r--r-- | bash-completion/ipcmk | 13 | ||||
| -rw-r--r-- | bash-completion/ipcrm | 32 | ||||
| -rw-r--r-- | bash-completion/lsipc | 9 |
3 files changed, 46 insertions, 8 deletions
diff --git a/bash-completion/ipcmk b/bash-completion/ipcmk index 696266cee7..0fbfaa4532 100644 --- a/bash-completion/ipcmk +++ b/bash-completion/ipcmk @@ -9,19 +9,30 @@ _ipcmk_module() COMPREPLY=( $(compgen -W "size" -- $cur) ) return 0 ;; + '-m'|'--posix-shmem') + COMPREPLY=( $(compgen -W "size" -- $cur) ) + return 0 + ;; '-S'|'--semaphore') COMPREPLY=( $(compgen -W "number" -- $cur) ) return 0 ;; + '-s'|'--posix-semaphore'|'-Q'|'--queue'|'-q'|'--posix-mqueue') + return 0 + ;; '-p'|'--mode') COMPREPLY=( $(compgen -W "mode" -- $cur) ) return 0 ;; + '-n'|'--name') + COMPREPLY=( $(compgen -W "name" -- $cur) ) + return 0 + ;; '-h'|'--help'|'-V'|'--version') return 0 ;; esac - COMPREPLY=( $(compgen -W "--shmem --semaphore --queue --mode --help --version" -- $cur) ) + COMPREPLY=( $(compgen -W "--shmem --posix-shmem --semaphore --posix-semaphore --queue --posix-mqueue --mode --name --help --version" -- $cur) ) return 0 } complete -F _ipcmk_module ipcmk diff --git a/bash-completion/ipcrm b/bash-completion/ipcrm index 1ed03f9ee6..6f4870a607 100644 --- a/bash-completion/ipcrm +++ b/bash-completion/ipcrm @@ -6,32 +6,47 @@ _ipcrm_module() prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-m'|'--shmem-id') - KEYIDS="$(ipcs -m | awk '{if (3 < NR) {print $2}}')" + KEYIDS="$(lsipc -m | awk 'NR>1 {print $2}')" COMPREPLY=( $(compgen -W "$KEYIDS" -- $cur) ) return 0 ;; '-M'|'--shmem-key') - KEYIDS="$(ipcs -m | awk '{if (3 < NR) {print $1}}')" + KEYIDS="$(lsipc -m | awk 'NR>1 {print $1}')" + COMPREPLY=( $(compgen -W "$KEYIDS" -- $cur) ) + return 0 + ;; + '--posix-shmem') + KEYIDS="$(lsipc -M | awk 'NR>1 {print $1}')" COMPREPLY=( $(compgen -W "$KEYIDS" -- $cur) ) return 0 ;; '-q'|'--queue-id') - KEYIDS="$(ipcs -q | awk '{if (3 < NR) {print $2}}')" + KEYIDS="$(lsipc -q | awk 'NR>1 {print $2}')" COMPREPLY=( $(compgen -W "$KEYIDS" -- $cur) ) return 0 ;; '-Q'|'--queue-key') - KEYIDS="$(ipcs -q | awk '{if (3 < NR) {print $1}}')" + KEYIDS="$(lsipc -q | awk 'NR>1 {print $1}')" + COMPREPLY=( $(compgen -W "$KEYIDS" -- $cur) ) + return 0 + ;; + '--posix-mqueue') + KEYIDS="$(lsipc -Q | awk 'NR>1 {print $1}')" COMPREPLY=( $(compgen -W "$KEYIDS" -- $cur) ) return 0 ;; '-s'|'--semaphore-id') - KEYIDS="$(ipcs -s | awk '{if (3 < NR) {print $2}}')" + KEYIDS="$(lsipc -s | awk '{if (3 < NR) {print $2}}')" COMPREPLY=( $(compgen -W "$KEYIDS" -- $cur) ) return 0 ;; '-S'|'--semaphore-key') - KEYIDS="$(ipcs -s | awk '{if (3 < NR) {print $1}}')" + KEYIDS="$(lsipc -s | awk '{if (3 < NR) {print $1}}')" + COMPREPLY=( $(compgen -W "$KEYIDS" -- $cur) ) + return 0 + ;; + '--posix-semaphore') + KEYIDS="$(lsipc -S | awk 'NR>1 {print $1}')" COMPREPLY=( $(compgen -W "$KEYIDS" -- $cur) ) return 0 ;; @@ -42,16 +57,19 @@ _ipcrm_module() case $cur in '=') cur=${cur#=} - COMPREPLY=( $(compgen -W "shm msg sem" -- $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 diff --git a/bash-completion/lsipc b/bash-completion/lsipc index a40fe42860..047126a444 100644 --- a/bash-completion/lsipc +++ b/bash-completion/lsipc @@ -9,6 +9,10 @@ _lsipc_module() COMPREPLY=( $(compgen -W "id" -- $cur) ) return 0 ;; + '-N'|'--name') + COMPREPLY=( $(compgen -W "name" -- $cur) ) + return 0 + ;; '-h'|'--help'|'-V'|'--version') return 0 ;; @@ -45,10 +49,14 @@ _lsipc_module() esac OPTS=" --shmems + --posix-shmems --queues + --posix-mqueues --semaphores + --posix-semaphores --global --id + --name --noheadings --notruncate --time-format @@ -62,6 +70,7 @@ _lsipc_module() --numeric-perms --raw --time + --shell --help --version " |
