__fish_man_page: ignore prefixing variable assignments

This commit is contained in:
Johannes Altmanninger 2019-12-19 23:41:26 +01:00
parent 1410f938aa
commit feb87bbda8
2 changed files with 3 additions and 3 deletions

View file

@ -10,8 +10,8 @@ function __fish_man_page
#Skip `sudo` and display then manpage of following command
while set -q args[2]
and test $args[1] = "sudo"
set args $args[2..-1]
and string match -qr -- '^(sudo|.*=.*)$' $args[1]
set -e args[1]
end
# If there are at least two tokens not starting with "-", the second one might be a subcommand.

View file

@ -1,5 +1,5 @@
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"
commandline -C 0
commandline -i "sudo "