Is there a way to support --switch=parameter syntax ??
Given the following program --help generates help text that doesn't seem to support --parameter=text format, but --parameter text
#lang cli
(flag (file in-file-path)
("-f" "--file" "filepath")
(file in-file-path))
(program (hello)
(displayln (file))
)
(run hello)
CLI output:
PS ... > D:\Racket\Racket.exe .\tmp.rkt --help
usage: hello [ <option> ... ]
<option> is one of
-f <in-file-path>, --file <in-file-path>
filepath to write the changelog to. Can NOTE use --file=foo must use --file foo
--help, -h
Show this help
--
Do not treat any remaining argument as a switch (at this level)
* Asterisks indicate options allowed multiple times.
Multiple single-letter switches can be combined after
one `-`. For example, `-h-` is the same as `-h --`.
PS ...> D:\Racket\Racket.exe .\tmp.rkt --file hello
hello
PS ...> D:\Racket\Racket.exe .\tmp.rkt --file=hello
hello: unknown switch: --file=hello
PS C:\Users\aias\Documents\Development\simple_changelog>
(but thank you very much for making this little language!)
Hi @rwilcox ! This package does not parse the command line syntax directly but instead simply leverages the command line arguments and flags reported by Racket's built-in current-command-line-arguments parameter. I did a quick google search to get a sense of how common the = syntax is, and I couldn't really say. At least one link mentioned it, but other links seemed to be unaware of it. Do you happen to know if it is considered a UNIX standard? If so, you may want to open an issue on the Racket repo directly to recognize this syntax in the core command line utilities. What do you think?
It’s in the libc docs, so I’m guessing it’s pretty common 😄
But OK, I may take a look at writing a command line program with the core utils, repro the issue and open a bug with Racket, that’s a good idea.
You can probably just use the example in the docs on the built-in command line utilities, which should be runnable as is. E.g. "link-flags" there takes an argument at the command line.
This has been on my radar for a while, but finally did something about it: https://github.com/racket/racket/issues/4106