Skip to content

Commit b9bf770

Browse files
committed
refactor(sudo): sort options alphabetically by short one
As it is in the --help output.
1 parent 94bbb3a commit b9bf770

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

completions/sudo

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ _comp_cmd_sudo()
88
local i mode=normal
99
[[ $1 == *sudoedit ]] && mode=edit
1010

11-
local noargopts='!(-*|*[uUgCp]*)'
11+
local noargopts='!(-*|*[CgpUu]*)'
1212
[[ $mode == normal ]] &&
1313
for ((i = 1; i <= cword; i++)); do
1414
if [[ ${words[i]} != -* ]]; then
@@ -23,7 +23,7 @@ _comp_cmd_sudo()
2323
break
2424
fi
2525
# shellcheck disable=SC2254
26-
[[ ${words[i]} == @(--@(user|other-user|group|close-from|prompt)|-${noargopts}[uUgCp]) ]] &&
26+
[[ ${words[i]} == @(--@(close-from|group|prompt|other-user|user)|-${noargopts}[CgpUu]) ]] &&
2727
((i++))
2828
done
2929

0 commit comments

Comments
 (0)