diff options
author | kate.ward <kate.ward@forestent.com> | 2008-10-19 17:21:41 +0000 |
---|---|---|
committer | kate.ward <kate.ward@forestent.com> | 2008-10-19 17:21:41 +0000 |
commit | 437639ddb30a6152f2d75271b9ac7438b94cd8a4 (patch) | |
tree | ca5c5c40b154203b22f1276035cbaf9ce2359d52 /source/1.0/src/shflags_test_public.sh | |
parent | b7fa8d622e4343e719b09808b38589a693732789 (diff) | |
download | shflags-437639ddb30a6152f2d75271b9ac7438b94cd8a4.tar.gz |
added the default value to help output
Diffstat (limited to 'source/1.0/src/shflags_test_public.sh')
-rwxr-xr-x | source/1.0/src/shflags_test_public.sh | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/source/1.0/src/shflags_test_public.sh b/source/1.0/src/shflags_test_public.sh index 5f9aa56..694356e 100755 --- a/source/1.0/src/shflags_test_public.sh +++ b/source/1.0/src/shflags_test_public.sh @@ -6,7 +6,7 @@ # # Author: kate.ward@forestent.com (Kate Ward) # -# shFlags unit test for the internal functions +# shFlags unit test for the public functions # load test helpers . ./shflags_test_helpers @@ -77,15 +77,21 @@ testStandardHelpOutput() flags_getoptIsEnh && startSkipping DEFINE_boolean test_bool false 'test boolean' b + DEFINE_integer test_int 0 'test integer' i DEFINE_string test_str '' 'test string' s + DEFINE_string long_desc 'blah' \ + 'testing of a long description to force wrap of default value' l help='USAGE: standard [flags] args' cat >"${expectedF}" <<EOF USAGE: standard [flags] args flags: - -b test boolean - -s test string - -h show this help + -b test boolean (default: false) + -i test integer (default: 0) + -s test string (default: '') + -l testing of a long description to force wrap of default value + (default: 'blah') + -h show this help (default: false) EOF ( FLAGS_HELP=${help}; FLAGS -h >"${stdoutF}" 2>"${stderrF}" ) diff "${expectedF}" "${stderrF}" >/dev/null @@ -101,15 +107,21 @@ testEnhancedHelpOutput() flags_getoptIsEnh || startSkipping DEFINE_boolean test_bool false 'test boolean' b + DEFINE_integer test_int 0 'test integer' i DEFINE_string test_str '' 'test string' s + DEFINE_string long_desc 'blah' \ + 'testing of a long description to force wrap of default value' l help='USAGE: enhanced [flags] args' cat >"${expectedF}" <<EOF USAGE: enhanced [flags] args flags: - -b,--[no]test_bool: test boolean - -s,--test_str: test string - -h,--[no]help: show this help + -b,--[no]test_bool: test boolean (default: false) + -i,--test_int: test integer (default: 0) + -s,--test_str: test string (default: '') + -l,--long_desc: testing of a long description to force wrap of default value + (default: 'blah') + -h,--[no]help: show this help (default: false) EOF ( FLAGS_HELP=${help}; FLAGS -h >"${stdoutF}" 2>"${stderrF}" ) diff "${expectedF}" "${stderrF}" >/dev/null |