List alias-created functions on alias sans args

The previous change I made here makes this not hard to do, but
kind of lame in implementation.
This commit is contained in:
Aaron Gyes 2016-10-28 22:29:02 -07:00
parent b663b0e818
commit c4bd110fca

View file

@ -1,4 +1,4 @@
function alias --description 'Legacy function for creating shellscript functions using an alias-like syntax'
function alias --description 'Creates a function wrapping a command'
if count $argv > /dev/null
switch $argv[1]
case -h --h --he --hel --help
@ -14,8 +14,10 @@ function alias --description 'Legacy function for creating shellscript functions
switch (count $argv)
case 0
echo "Fish implements aliases using functions. Use 'functions' builtin to see list of functions and 'functions function_name' to see function definition, type 'help alias' for more information."
return 1
for func in (functions -n)
functions $func | string match -- "function * --description 'alias *" | string replace -r -- "function .* --description '" ''| string trim -c\'
end
return 0
case 1
set -l tmp (string replace -r "=" '\n' -- $argv) ""
set name $tmp[1]