tide/functions/tide.fish

28 lines
803 B
Fish
Raw Normal View History

2020-06-07 03:51:24 +03:00
function tide
2020-07-23 20:57:40 +03:00
argparse --stop-nonopt 'v/version' 'h/help' -- $argv
2020-06-07 03:51:24 +03:00
if set -q _flag_version
printf '%s\n' "tide, version $_tide_version"
2020-09-23 23:56:08 +03:00
else if set -q _flag_help
2020-07-23 20:57:40 +03:00
_tide_help
2020-11-21 00:51:18 +03:00
else if functions --query _tide_sub_$argv[1]
_tide_sub_$argv[1] $argv[2..-1]
2020-05-19 06:03:25 +03:00
else
2020-07-23 20:57:40 +03:00
_tide_help
return 1
2020-05-19 06:03:25 +03:00
end
2020-07-23 20:57:40 +03:00
end
function _tide_help
2020-11-21 00:51:18 +03:00
printf '%s\n' \
'Usage: tide [options] subcommand [options]' \
'' \
'Options:' \
' -v or --version print tide version number' \
' -h or --help print this help message' \
'' \
'Subcommands:' \
' configure run interactive configuration wizard' \
' bug-report print info for use in bug reports' \
' test run tests for developers'
2020-05-19 06:03:25 +03:00
end