From b9f2ad6b22fe6808a5cd2a1476172a1131adb3ed Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Fri, 12 Jun 2026 10:59:00 -0300 Subject: Accept getopts-style attached -pPROFILE again Via gobang.ExpandBundles("p:", argv), now that it understands optstring value flags: -pp1 expands to -p p1 before stdlib flag parsing, and nothing after "--" is expanded, so the wrapped command's own argv passes through byte-for-byte. signals.sh goes back to its original attached-form invocations, which now double as the compat test. Co-Authored-By: Claude Fable 5 --- tests/remembering.go | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'tests/remembering.go') diff --git a/tests/remembering.go b/tests/remembering.go index 3f8e446..5c3b705 100644 --- a/tests/remembering.go +++ b/tests/remembering.go @@ -505,6 +505,29 @@ func test_run_flow() { assertEq(out, "x\n") assertEq(errW, "warn\n") }) + + testing("attached -pNAME is accepted", func() { + rc, out, _ := runWith( + "b\na\n", + "-pt8", "--", "head", "-n1", + ) + assertEq(rc, 0) + assertEq(out, "a\n") + assertEq( + profileContent("t8"), + "1 profile a\n0 profile b\n", + ) + }) + + testing("-- shields the command's argv", func() { + rc, out, _ := runWith( + "", + "-p", "t9", "--", + "sh", "-c", "echo \"$0\"", "-pz", + ) + assertEq(rc, 0) + assertEq(out, "-pz\n") + }) }) } -- cgit v1.3