take -o - as stdout

getopt-long reads a lone `-' as an option, so -o - died there asking
for a value, and --output=- got through only to create a file named
`-'.

Fixes #43.
This commit is contained in:
2026-10-09 17:34:02 +03:00
parent 42fe477e35
commit a14484d1dc
2 changed files with 28 additions and 4 deletions

View File

@@ -52,4 +52,16 @@
(test "an empty command line is handled"
'()
(args-before-separator '())))
(args-before-separator '()))
;; getopt-long reads a lone `-' as an option and refused `-o -', so
;; it is handed the one spelling it takes a dash in
(test "-o - reaches getopt-long as a value"
'("x.sex" "--output=-" "-C")
(spell-stdout-output '("x.sex" "-o" "-" "-C")))
(test "and so does --output -"
'("--output=-")
(spell-stdout-output '("--output" "-")))
(test "any other output is left alone"
'("-o" "out" "-")
(spell-stdout-output '("-o" "out" "-"))))