fix: add alias for script
This commit is contained in:
@@ -8,7 +8,7 @@ function execute-script
|
||||
set -l script_dir $dotfile_dir/script
|
||||
set -l script_name $argv[1]
|
||||
|
||||
# ff script -h / --help / help
|
||||
# ff script|s -h / --help / help
|
||||
if test -z "$script_name"; or contains -- $script_name -h --help help
|
||||
if test -z "$script_name"; or test (count $argv) -eq 1
|
||||
script-show-catalog
|
||||
|
||||
@@ -11,6 +11,7 @@ function ff
|
||||
"pst|Show proxy status" \
|
||||
"make|Run dotfile Makefile commands" \
|
||||
"script|Run script from script directory" \
|
||||
"s|Alias for script" \
|
||||
"update|Update dotfile" \
|
||||
"region|Toggle or set CN_REGION (mirror/proxy region)" \
|
||||
"ssh|SSH init (keys + config.d) or copy config to remote" \
|
||||
@@ -62,12 +63,7 @@ function ff
|
||||
else
|
||||
echo "Error: Dotfile directory not found at $dotfile_dir"
|
||||
end
|
||||
case script
|
||||
if not functions -q execute-script
|
||||
source ~/.dotfile/fish/functions/execute-script.fish
|
||||
end
|
||||
execute-script $argv[2..-1]
|
||||
case s
|
||||
case script s
|
||||
if not functions -q execute-script
|
||||
source ~/.dotfile/fish/functions/execute-script.fish
|
||||
end
|
||||
|
||||
@@ -110,7 +110,7 @@ end
|
||||
|
||||
function script-show-catalog
|
||||
set -l script_dir ~/.dotfile/script
|
||||
echo "Usage: ff script <name> [args...]"
|
||||
echo "Usage: ff script <name> [args...] (alias: ff s)"
|
||||
echo ""
|
||||
echo "Scripts in $script_dir:"
|
||||
echo ""
|
||||
@@ -122,5 +122,5 @@ function script-show-catalog
|
||||
end
|
||||
|
||||
echo ""
|
||||
echo "提示: ff script <name> -h 查看单个脚本内的详细帮助"
|
||||
echo "提示: ff s <name> -h 查看单个脚本内的详细帮助"
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user