Open guw opened 3 years ago
Well I can tell you that it has nothing to do with your shell. I tested it with BASH and the same happens. The code parsing the usage string into getopts arguments is not sophisticated enough or maybe it was never intended to support that. But don't let me stop you from scratching that itch of yours. We all would certainly welcome this new feature. :-)
Oh, so I read the documentation wrong. Sorry about that. When reading https://github.com/kvz/bash3boilerplate/blob/986fec809095d5df2d71c08262ab9a705ec373f2/main.sh#L136 I assumed it would work in the default.
Nice catch. Might be that this comment is from a time before the big rewrite of the usage string parsing. Of course this means that either the code is wrong or the comment.
I might be doing something wrong but it looks like variable expansion is not working for default values in my sell environment (Big Sur, Fish shell).
I have
Further down I have:
Here is my output:
The interesting thing is that it really prints out
${HOME}
instead of/Users/myusername
. However, when I use${HOME}
directly in the script it works.One observation from my shell: