aboutsummaryrefslogtreecommitdiffhomepage
path: root/share/functions/funcsave.fish
diff options
context:
space:
mode:
authorGravatar Dylan Smith <dylan.ah.smith@gmail.com>2010-11-20 01:42:11 -0500
committerGravatar Grissiom <chaos.proton@gmail.com>2010-12-02 01:13:51 +0800
commitfd4ac87382a4873df649cdacf1c65155cb9b2c4d (patch)
treecf996f574f1bac93c03cbcb8a8a4901784183632 /share/functions/funcsave.fish
parent164144f1265b26446eafa16091e0eed9e2344a9d (diff)
funcsave: Fixed error and help handling.
Renamed references to the previous command name of save_function to funcsave, and returned an error after printing the help text when no arguments are specified.
Diffstat (limited to 'share/functions/funcsave.fish')
-rw-r--r--share/functions/funcsave.fish10
1 files changed, 6 insertions, 4 deletions
diff --git a/share/functions/funcsave.fish b/share/functions/funcsave.fish
index ff9cabb5..a1725ca9 100644
--- a/share/functions/funcsave.fish
+++ b/share/functions/funcsave.fish
@@ -4,11 +4,13 @@ function funcsave --description "Save the current definition of all specified fu
if count $argv >/dev/null
switch $argv[1]
case -h --h --he --hel --help
- __fish_print_help save_function
+ __fish_print_help funcsave
return 0
end
else
- __fish_print_help save_function
+ printf (_ "%s: Expected function name\n") funcsave
+ __fish_print_help funcsave
+ return 1
end
set -l res 0
@@ -21,7 +23,7 @@ function funcsave --description "Save the current definition of all specified fu
for i in $configdir $configdir/fish $configdir/fish/functions
if not test -d $i
if not command mkdir $i >/dev/null
- printf (_ "%s: Could not create configuration directory\n") save_function
+ printf (_ "%s: Could not create configuration directory\n") funcsave
return 1
end
end
@@ -32,7 +34,7 @@ function funcsave --description "Save the current definition of all specified fu
functions $i > $configdir/fish/functions/$i.fish
functions -e $i
else
- printf (_ "%s: Unknown function '%s'\n") save_function $i
+ printf (_ "%s: Unknown function '%s'\n") funcsave $i
set res 1
end
end