feat(sudo): option arg (non-)completion improvements#1683
Conversation
akinomyoga
left a comment
There was a problem hiding this comment.
pre-approving with the following points.
| fi | ||
| # shellcheck disable=SC2254 | ||
| [[ ${words[i]} == @(--@(close-from|chdir|group|host|prompt|chroot|role|command-timeout|type|other-user|user)|-${noargopts}[CDghpRrTtUu]) ]] && | ||
| [[ ${words[i]} == @(--@(close-from|chdir|group|host|prompt|chroot|role|command-timeout|type|other-user|user|preserve-env)|-${noargopts}[CDghpRrTtUu]) ]] && |
There was a problem hiding this comment.
I think the ordering of the list of the long option names is roughly based on the ordering in the man page. Then, I think preserve-env should be inserted after chdir (based on the man page in sudo-1.9.15p5). For the same reason, I think command-timeout should be moved after other-user (or after type if one bases on sudo --help instead of the man page). Another option is to sort them in lexicographical order.
There was a problem hiding this comment.
I have not compared the two, but the ordering seemed to be roughly that of the --help output, and --preserve-end is at the end with sudo-rs so it ended up there.
Reordered all of them in 80156e3, merging with that.
| --close-from | --help | --prompt | --role | --type | \ | ||
| --command-timeout | --preserve-env | --version | \ |
There was a problem hiding this comment.
Similarly, --preserve-env should be inserted after --close-from.
That of the original sudo.ws one.
No description provided.