From dc7b8557d6bbcbdcef9874ff199bf93a39a11c32 Mon Sep 17 00:00:00 2001 From: Christian Schneider Date: Mon, 22 Apr 2024 18:29:14 +0200 Subject: Add test to ensure and document that leading dashes are not allowed in non-option args even with -- in command line --- test/exec.t | 1 + 1 file changed, 1 insertion(+) (limited to 'test') diff --git a/test/exec.t b/test/exec.t index 9e55726..237d59b 100755 --- a/test/exec.t +++ b/test/exec.t @@ -14,6 +14,7 @@ is(it::shell_command("echo {arg}", ['arg' => false]), "echo ", "remove is(it::shell_command("echo {arg}", ['arg' => []]), "echo ", "remove empty arrays"); is(it::shell_command("echo {arg}", (object)['arg' => "foo"]) , "echo foo", "allow objects"); is(it::shell_command("echo {arg}", ['arg' => 1], ['arg' => 2]), "echo 2", "support varargs"); +errlike(fn() => it::shell_command("echo -- $(echo {arg})", ['arg' => "-1"]), "leading - in value", "disallow leading dash in non-option args"); is( -- cgit v1.2.3