diff options
author | EuAndreh <eu@euandre.org> | 2023-02-17 15:07:30 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2023-02-17 15:07:32 -0300 |
commit | 44b1e103b4d3a24aee89587ef302891e9f9c3807 (patch) | |
tree | a8e4045218bd1075b687dd5a6f1d023e6c407bff /bin/rfc | |
parent | etc/nix/configuration.nix: Add flutter2 and hover packages (diff) | |
download | dotfiles-44b1e103b4d3a24aee89587ef302891e9f9c3807.tar.gz dotfiles-44b1e103b4d3a24aee89587ef302891e9f9c3807.tar.xz |
bin/: Use explicit "--" separator for assert-arg usages
In order to prevent legitimate cases to fail as errors, such as:
NUM='-10'
eval "$(assert-arg "$NUM" '-n NUM')"
To prevent assert-arg(1) from treating "-10" as the options "-1 and -0,
they need to be put after the "--" separator.
This way, all usages of assert-arg(1) that had its first argument as a
variable were adapted, and the usage and examples of assert-arg itself
were updated to encourage this best practice.
Diffstat (limited to 'bin/rfc')
-rwxr-xr-x | bin/rfc | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -133,7 +133,7 @@ if [ "${UPDATE:-}" = true ]; then exit fi -eval "$(assert-arg "$RFC_NUMBER" 'RFC_NUMBER')" +eval "$(assert-arg -- "$RFC_NUMBER" 'RFC_NUMBER')" if [ ! -e "$F" ]; then printf 'Given RFC_NUMBER "%s" does not exist at:\n%s\n' \ |