Slim down tide test help message

This commit is contained in:
Ilan Cosman 2020-11-24 14:44:46 -08:00
parent 5ec4a8bf4c
commit d4bc14578b

View File

@ -17,7 +17,7 @@ function _tide_sub_test
return 1 return 1
end end
set -lx TERM xterm # Necessary for testing purposes, ensures color codes are printed set -lx TERM xterm # Ensures color codes are printed
set -l testsDir "$_tide_dir/tests" set -l testsDir "$_tide_dir/tests"
@ -25,8 +25,6 @@ function _tide_sub_test
set -l failed (mktemp -u) set -l failed (mktemp -u)
set -l passed (mktemp -u) set -l passed (mktemp -u)
set -l returnStatement 0
set -q _flag_all && set argv (basename -s '.fish' $testsDir/*.fish) set -q _flag_all && set argv (basename -s '.fish' $testsDir/*.fish)
set -q _flag_CI && set -a argv 'CI/'(basename -s '.fish' $testsDir/CI/*.fish) set -q _flag_CI && set -a argv 'CI/'(basename -s '.fish' $testsDir/CI/*.fish)
@ -64,31 +62,13 @@ function _tide_sub_test
end end
function _tide_test_help function _tide_test_help
set -l b (set_color -o; or echo) printf '%s\n' \
set -l n (set_color normal; or echo) 'Usage: tide test [options] [tests]' \
set -l bl (set_color $_tide_color_light_blue; or echo) '' \
'Options:' \
set -l optionList \ ' -v or --verbose print test output even if passed' \
' -v or --verbose' \ ' -a or --all run all available tests' \
' -a or --all' \ ' -h or --help print this help message' \
' -h or --help' \ ' -i or --install install testing dependencies' \
' -i or --install' \ ' --CI run tests designed for CI'
' --CI'
set -l descriptionList \
'display test output even if passed' \
'run all available tests' \
'print this help message' \
'install testing dependencies' \
'run tests designed for CI'
printf '%s\n' 'Usage: '$bl'tide test '$n'[options] '$b'[TESTS...]'$n
printf '%s\n'
printf '%s\n' 'Options:'
for option in $optionList
printf '%s' $option
printf '%b' '\r'
_tide_cursor_right 19
set -l descriptionIndex (contains --index -- $option $optionList)
printf '%s\n' $descriptionList[$descriptionIndex]
end
end end