From 44b1e103b4d3a24aee89587ef302891e9f9c3807 Mon Sep 17 00:00:00 2001
From: EuAndreh <eu@euandre.org>
Date: Fri, 17 Feb 2023 15:07:30 -0300
Subject: 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.
---
 bin/forever | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'bin/forever')

diff --git a/bin/forever b/bin/forever
index d4410e5..1ecc2a8 100755
--- a/bin/forever
+++ b/bin/forever
@@ -58,7 +58,7 @@ while getopts 'h' flag; do
 done
 shift $((OPTIND - 1))
 
-eval "$(assert-arg "${1:-}" 'COMMAND')"
+eval "$(assert-arg -- "${1:-}" 'COMMAND')"
 
 
 while true; do
-- 
cgit v1.2.3