[x] Per GitHub's Terms of Service, I am aware that I license my
contribution under the same terms as this project's license, and
that I have the right to license my contribution under those terms.
cc: @mbland
The --help-filter option and the # Help filter comment is too much for the user for sth that they may need to implement in every command script they write. Also, it limits a bit some use cases, for instance using docopts together with go-script-bash.
This PR adds a new associative array _GO_HELP_TOKENS. Each item in the array is a token=>replacement pair and go-script-bash automatically performs any replacements when generating the help text. This is complementary to the --help-filter method, which is compatible with old bash versions.
Coverage increased (+0.03%) to 95.031% when pulling b34c9d4b5edbd8442ba895bb892dc897eb54cba9 on nkakouros-forks:help-tokens into 292e0803074eb538ab8633a657c53d3a975ba922 on mbland:master.
cc: @mbland
The
--help-filter
option and the# Help filter
comment is too much for the user for sth that they may need to implement in every command script they write. Also, it limits a bit some use cases, for instance using docopts together with go-script-bash.This PR adds a new associative array
_GO_HELP_TOKENS
. Each item in the array is a token=>replacement pair and go-script-bash automatically performs any replacements when generating the help text. This is complementary to the--help-filter
method, which is compatible with old bash versions.