2020-06-07 03:51:24 +03:00
|
|
|
function tide
|
2021-03-02 20:46:40 +03:00
|
|
|
argparse --stop-nonopt v/version h/help -- $argv
|
2020-06-07 03:51:24 +03:00
|
|
|
|
|
|
|
if set -q _flag_version
|
2021-08-14 02:09:45 +03:00
|
|
|
printf '%s\n' "tide, version 5.0.1"
|
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
|
2020-07-16 23:51:42 +03:00
|
|
|
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' \
|
2021-01-25 22:22:28 +03:00
|
|
|
' bug-report print info for use in bug reports'
|
2021-03-02 20:46:40 +03:00
|
|
|
end
|