mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-28 13:53:10 +00:00
__fish_man_page: ignore prefixing variable assignments
This commit is contained in:
parent
1410f938aa
commit
feb87bbda8
2 changed files with 3 additions and 3 deletions
|
@ -10,8 +10,8 @@ function __fish_man_page
|
||||||
|
|
||||||
#Skip `sudo` and display then manpage of following command
|
#Skip `sudo` and display then manpage of following command
|
||||||
while set -q args[2]
|
while set -q args[2]
|
||||||
and test $args[1] = "sudo"
|
and string match -qr -- '^(sudo|.*=.*)$' $args[1]
|
||||||
set args $args[2..-1]
|
set -e args[1]
|
||||||
end
|
end
|
||||||
|
|
||||||
# If there are at least two tokens not starting with "-", the second one might be a subcommand.
|
# If there are at least two tokens not starting with "-", the second one might be a subcommand.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
function __fish_prepend_sudo -d "Prepend 'sudo ' to the beginning of the current commandline"
|
function __fish_prepend_sudo -d "Prepend 'sudo ' to the beginning of the current commandline"
|
||||||
set -l cmd (commandline -boc)
|
set -l cmd (commandline -poc)
|
||||||
if test "$cmd[1]" != "sudo"
|
if test "$cmd[1]" != "sudo"
|
||||||
commandline -C 0
|
commandline -C 0
|
||||||
commandline -i "sudo "
|
commandline -i "sudo "
|
||||||
|
|
Loading…
Reference in a new issue