mirror of
https://github.com/oh-my-fish/oh-my-fish.git
synced 2024-11-30 12:33:37 +08:00
12 lines
321 B
Fish
12 lines
321 B
Fish
|
function balias --argument alias command
|
||
|
eval 'alias $alias $command'
|
||
|
if expr match $command '^sudo '>/dev/null
|
||
|
set command (expr substr + $command 6 (expr length $command))
|
||
|
end
|
||
|
complete -c $alias -xa "(
|
||
|
set -l cmd (commandline -pc | sed -e 's/^ *\S\+ *//' );
|
||
|
complete -C\"$command \$cmd\";
|
||
|
)"
|
||
|
end
|
||
|
|