tide/functions/tide.fish

19 lines
456 B
Fish
Raw Normal View History

2020-06-07 03:51:24 +03:00
function tide
argparse --stop-nonopt 'v/version' -- $argv
2020-06-07 03:51:24 +03:00
set -l subcommand $argv[1]
if set -q _flag_version
printf '%s\n' $_tide_version
return 0
end
2020-07-14 07:07:11 +03:00
set -l actual_command_name "tide_$subcommand"
2020-05-19 06:03:25 +03:00
2020-07-14 07:07:11 +03:00
if contains $subcommand $_tide_subcommands
2020-05-20 20:39:44 +03:00
source "$_tide_dir/functions/$subcommand.fish"
2020-07-14 07:07:11 +03:00
$actual_command_name $argv[2..-1]
2020-05-19 06:03:25 +03:00
else
tide help
end
2020-07-14 07:07:11 +03:00
functions -e $actual_command_name
2020-05-19 06:03:25 +03:00
end