diff options
author | 2006-09-14 03:13:10 +1000 | |
---|---|---|
committer | 2006-09-14 03:13:10 +1000 | |
commit | 4037219dc062acaf3792b818cceb8cc9ef3d5bcb (patch) | |
tree | 4642aca375c28891a54538af93001afb163675ea /share | |
parent | 1612ec50fbac4344f365fb31a15240834c01eaeb (diff) |
Make sude completions include /sbin and /usr/sbin in PATH. Thanks to Xavier Douville for the suggestion.
darcs-hash:20060913171310-ac50b-a9e30533bc634f194f73fdee1e042d407f55fcac.gz
Diffstat (limited to 'share')
-rw-r--r-- | share/completions/sudo.fish | 2 | ||||
-rw-r--r-- | share/functions/__fish_complete_subcommand_root.fish | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/share/completions/sudo.fish b/share/completions/sudo.fish index a88f9182..b497e8bd 100644 --- a/share/completions/sudo.fish +++ b/share/completions/sudo.fish @@ -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") diff --git a/share/functions/__fish_complete_subcommand_root.fish b/share/functions/__fish_complete_subcommand_root.fish new file mode 100644 index 00000000..49504ce4 --- /dev/null +++ b/share/functions/__fish_complete_subcommand_root.fish @@ -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 |