summaryrefslogtreecommitdiffstats
path: root/completions/iscsiadm
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--completions/iscsiadm31
1 files changed, 16 insertions, 15 deletions
diff --git a/completions/iscsiadm b/completions/iscsiadm
index 7786ddc..84cc817 100644
--- a/completions/iscsiadm
+++ b/completions/iscsiadm
@@ -1,31 +1,32 @@
# iscsiadm(1) completion -*- shell-script -*-
-_iscsiadm()
+_comp_cmd_iscsiadm()
{
- local cur prev words cword split
- _init_completion -s || return
+ local cur prev words cword was_split comp_args
+ _comp_initialize -s -- "$@" || return
+ local noargopts='!(-*|*[motLU]*)'
+ # shellcheck disable=SC2254
case $prev in
- --mode | -!(-*)m)
- COMPREPLY=($(compgen -W 'discovery node session iface fw host' \
- -- "$cur"))
+ --mode | -${noargopts}m)
+ _comp_compgen -- -W 'discovery node session iface fw host'
return
;;
- --op | -!(-*)o)
- COMPREPLY=($(compgen -W 'new delete update show' -- "$cur"))
+ --op | -${noargopts}o)
+ _comp_compgen -- -W 'new delete update show'
return
;;
- --type | -!(-*)t)
- COMPREPLY=($(compgen -W 'sendtargets st slp isns fw' -- "$cur"))
+ --type | -${noargopts}t)
+ _comp_compgen -- -W 'sendtargets st slp isns fw'
return
;;
- --loginall | --logoutall | -!(-*)[LU])
- COMPREPLY=($(compgen -W 'all manual automatic' -- "$cur"))
+ --loginall | --logoutall | -${noargopts}[LU])
+ _comp_compgen -- -W 'all manual automatic'
return
;;
esac
- $split && return
+ [[ $was_split ]] && return
local options
if ((cword > 1)); then
@@ -59,8 +60,8 @@ _iscsiadm()
options='--mode'
fi
- COMPREPLY=($(compgen -W "$options" -- "$cur"))
+ _comp_compgen -- -W "$options"
} &&
- complete -F _iscsiadm iscsiadm
+ complete -F _comp_cmd_iscsiadm iscsiadm
# ex: filetype=sh