tide/functions/tide.fish

28 lines
740 B
Fish
Raw Normal View History

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-02-23 01:37:43 +03:00
printf '%s\n' "tide, version 4.1.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
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