mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 12:53:13 +00:00
parent
6b41240cd2
commit
960cc628b2
1 changed files with 5 additions and 2 deletions
|
@ -15,7 +15,9 @@ function alias --description 'Creates a function wrapping a command'
|
|||
|
||||
case 0
|
||||
for func in (functions -n)
|
||||
functions $func | string match -- "function * --description 'alias *" | string replace -r -- "function .* --description '" ''| string trim -c\'
|
||||
set -l output (functions $func | string match -r -- "function .* --description '(alias .*)'" | string split \n)
|
||||
set -q output[2]
|
||||
and echo $output[2]
|
||||
end
|
||||
return 0
|
||||
case 1
|
||||
|
@ -62,5 +64,6 @@ function alias --description 'Creates a function wrapping a command'
|
|||
set prefix command
|
||||
end
|
||||
end
|
||||
echo "function $name --wraps $first_word --description \"alias $argv\"; $prefix $first_word $body \$argv; end" | source
|
||||
set -l cmd_string (string escape "alias $argv")
|
||||
echo "function $name --wraps $first_word --description $cmd_string; $prefix $first_word $body \$argv; end" | source
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue