mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-13 21:44:16 +00:00
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:
parent
b663b0e818
commit
c4bd110fca
1 changed files with 5 additions and 3 deletions
|
@ -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
|
if count $argv > /dev/null
|
||||||
switch $argv[1]
|
switch $argv[1]
|
||||||
case -h --h --he --hel --help
|
case -h --h --he --hel --help
|
||||||
|
@ -14,8 +14,10 @@ function alias --description 'Legacy function for creating shellscript functions
|
||||||
switch (count $argv)
|
switch (count $argv)
|
||||||
|
|
||||||
case 0
|
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."
|
for func in (functions -n)
|
||||||
return 1
|
functions $func | string match -- "function * --description 'alias *" | string replace -r -- "function .* --description '" ''| string trim -c\'
|
||||||
|
end
|
||||||
|
return 0
|
||||||
case 1
|
case 1
|
||||||
set -l tmp (string replace -r "=" '\n' -- $argv) ""
|
set -l tmp (string replace -r "=" '\n' -- $argv) ""
|
||||||
set name $tmp[1]
|
set name $tmp[1]
|
||||||
|
|
Loading…
Reference in a new issue