From f2621414ee5f2f601424c22f00e207903e3b6104 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 4 May 2024 03:03:18 +0200 Subject: Merging upstream version 1:2.12.0. Signed-off-by: Daniel Baumann --- completions/iscsiadm | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) (limited to 'completions/iscsiadm') 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 -- cgit v1.2.3