Skip to content

Commit ec907d9

Browse files
committed
refactor(ipmitool): filter -d optargs by compgen -X
1 parent b88152e commit ec907d9

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

completions/ipmitool

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,7 @@ _ipmitool()
1919
local -a files
2020
_comp_expand_glob files '/dev/ipmi* /dev/ipmi/* /dev/ipmidev/*'
2121
((${#files[@]})) &&
22-
COMPREPLY=($(compgen -W "$(
23-
printf '%s\n' "${files[@]}" |
24-
command sed -ne 's/^[^0-9]*\([0-9]\{1,\}\)/\1/p'
25-
)" \
26-
-- "$cur"))
22+
COMPREPLY=($(compgen -W '"${files[@]##*([^0-9])}"' -X '![0-9]*' -- "$cur"))
2723
return
2824
;;
2925
-*I)

0 commit comments

Comments
 (0)