2020-06-07 03:51:24 +03:00
|
|
|
function tide
|
|
|
|
argparse 'v/version' -- $argv
|
|
|
|
set -l subcommand $argv[1]
|
|
|
|
|
|
|
|
if set -q _flag_version
|
|
|
|
printf '%s\n' $_tide_version
|
|
|
|
return 0
|
|
|
|
end
|
|
|
|
|
2020-05-19 06:03:25 +03:00
|
|
|
set -l tideSubcommand "tide_$subcommand"
|
2020-05-25 01:37:09 +03:00
|
|
|
set -l tideCommands (basename -a -s '.fish' $_tide_dir/functions/*)
|
2020-05-19 06:03:25 +03:00
|
|
|
|
|
|
|
if contains $subcommand $tideCommands
|
2020-05-20 20:39:44 +03:00
|
|
|
source "$_tide_dir/functions/$subcommand.fish"
|
2020-05-19 06:03:25 +03:00
|
|
|
$tideSubcommand $argv[2..-1]
|
|
|
|
else
|
|
|
|
tide help
|
|
|
|
end
|
|
|
|
functions -e $tideSubcommand
|
|
|
|
end
|