diff options
| author | EuAndreh <eu@euandre.org> | 2026-06-12 10:59:00 -0300 |
|---|---|---|
| committer | EuAndreh <eu@euandre.org> | 2026-06-12 10:59:00 -0300 |
| commit | b9f2ad6b22fe6808a5cd2a1476172a1131adb3ed (patch) | |
| tree | 56b7153976edf43fe92b17917209e9a4fadd2112 /tests/remembering.go | |
| parent | Rewrite remembering in Go (diff) | |
| download | remembering-b9f2ad6b22fe6808a5cd2a1476172a1131adb3ed.tar.gz remembering-b9f2ad6b22fe6808a5cd2a1476172a1131adb3ed.tar.xz | |
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 <noreply@anthropic.com>
Diffstat (limited to 'tests/remembering.go')
| -rw-r--r-- | tests/remembering.go | 23 |
1 files changed, 23 insertions, 0 deletions
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") + }) }) } |
