| ▲ | refp 6 hours ago | |
Yo, author here. You are very much correct and I 100% agree with you, I have updated the first example to include a snippet where a proper env-var is used to show of the automatic diagnostic. Thanks for your feedback, much much appreciated! | ||
| ▲ | wolletd an hour ago | parent | next [-] | |
For a short-lived script, the `${1:?missing argument}` stuff may be useful, but usually, I want to print some longer usage or help text in the error case. I usually go with something like this:
The `${1:-}` in this case evaluates to an empty string if `$1` is not set, but `shift` fails when there is no argument to remove. | ||
| ▲ | 3 hours ago | parent | prev [-] | |
| [deleted] | ||