mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-13 05:28:49 +00:00
Make sude completions include /sbin and /usr/sbin in PATH. Thanks to Xavier Douville for the suggestion.
darcs-hash:20060913171310-ac50b-a9e30533bc634f194f73fdee1e042d407f55fcac.gz
This commit is contained in:
parent
1612ec50fb
commit
4037219dc0
2 changed files with 9 additions and 1 deletions
|
@ -2,7 +2,7 @@
|
|||
# Completion for sudo
|
||||
#
|
||||
|
||||
complete -c sudo -d (N_ "Command to run") -x -a "(__fish_complete_subcommand)"
|
||||
complete -c sudo -d (N_ "Command to run") -x -a '(__fish_complete_subcommand_root)'
|
||||
|
||||
complete -c sudo -s h -n "__fish_no_arguments" -d (N_ "Display help and exit")
|
||||
complete -c sudo -s v -n "__fish_no_arguments" -d (N_ "Validate")
|
||||
|
|
8
share/functions/__fish_complete_subcommand_root.fish
Normal file
8
share/functions/__fish_complete_subcommand_root.fish
Normal file
|
@ -0,0 +1,8 @@
|
|||
|
||||
|
||||
function __fish_complete_subcommand_root -d "Run the __fish_complete_subcommand function using a PATH containing /sbin and /usr/sbin"
|
||||
set -l PATH_OLD $PATH
|
||||
set PATH /sbin /usr/sbin $PATH
|
||||
__fish_complete_subcommand
|
||||
set PATH $PATH_OLD
|
||||
end
|
Loading…
Reference in a new issue