oh-my-fish/plugins/balias/balias.fish
2015-03-18 08:53:36 +09:00

11 lines
295 B
Fish

function balias --argument alias command
eval 'alias $alias $command'
if expr $command : '^sudo '>/dev/null
set command (echo "$command" | cut -c6-)
end
complete -c $alias -xa "(
set -l cmd (commandline -pc | sed -e 's/^ *\S\+ *//' );
complete -C\"$command \$cmd\";
)"
end