mirror of
https://github.com/IlanCosman/tide.git
synced 2024-12-18 09:32:18 +03:00
20 lines
494 B
Fish
20 lines
494 B
Fish
function tide
|
|
argparse 'v/version' -- $argv
|
|
set -l subcommand $argv[1]
|
|
|
|
if set -q _flag_version
|
|
printf '%s\n' $_tide_version
|
|
return 0
|
|
end
|
|
|
|
set -l tideSubcommand "tide_$subcommand"
|
|
set -l tideCommands (basename -a -s '.fish' $_tide_dir/functions/*)
|
|
|
|
if contains $subcommand $tideCommands
|
|
source "$_tide_dir/functions/$subcommand.fish"
|
|
$tideSubcommand $argv[2..-1]
|
|
else
|
|
tide help
|
|
end
|
|
functions -e $tideSubcommand
|
|
end |