prole/tests/shellspec/.vendor/shellspec-0.28.1/spec/getoptions_help_spec.sh
chrisfu 909e92109e Refactor shell layout; add shellspec + authority
- Introduce lib/shell helpers and keep etc/* scripts thin via compatibility shims

- Move Kerberos validation to scripts/validation/check_kerberos.sh and update callers

- Add deterministic shellspec unit tests under tests/shellspec/ and wire Maven to run them

- Add minimal Spring Boot authority module with startup + /health endpoint and Maven wiring

- Document the new layout in docs/layout.md

Co-authored-by: Junie <junie@jetbrains.com>
2026-03-13 09:19:56 -07:00

43 lines
1.1 KiB
Bash

# shellcheck shell=sh disable=SC1083,SC2004,SC2016
Describe "getoptions_help()"
Include ./lib/getoptions_help.sh
usage() {
eval "$(getoptions_help parser_definition _usage)"
case $# in
0) _usage ;;
*) _usage "$@" ;;
esac
}
It "generates usage"
parser_definition() { echo 'usage'; }
When call usage
The output should eq "usage"
The status should be success
End
It "displays usage"
parser_definition() {
setup - width:20 plus:true -- 'usage'
msg -- "header"
msg label:option -- "description"
flag FLAG_A -a +a --{no-}flag-a -- "flag a"
setup - width:25 hidden
param PARAM_P -p -- "param p"
option OPTION_O -o -- "option o"
msg -- "footer"
}
When call usage
The line 1 should eq "usage"
The line 2 should eq "header"
The line 3 should eq " option description"
The line 4 should eq " -a, +a, --{no-}flag-a "
The line 5 should eq " flag a"
The line 6 should eq " -p PARAM_P param p"
The line 7 should eq " -o[=OPTION_O] option o"
The line 8 should eq "footer"
End
End