Closed bertBruynooghe closed 6 years ago
Use --
to tell the option parser to stop parsing options/flags:
nf run -- testcafe chrome:headless ./*.js --screenshots ./
This tells the option parser in nf
to stop parsing options at --
and treat everything after it as standard positional arguments (aka, unprocessed strings).
I was curious how foreman
supported this, since what you described is somewhat non-standard behaviour for a CLI program, so I just took a look. The Thor gem it uses for CLI parsing has a #stop_on_unknown_option!
method in the API that does pretty much what it says.
...1 hour** of internet archeology later
Fun fact: the --
convention (per getopt(1)
and getopt(3)
) for stopping parsing CLI args was first documented in the AT&T System V Users Manual from 1983 😮
** ok, it was more like 3 hours, and was very entertaining 😊
👍
In:
nf run testcafe \"chrome:headless\" ./*.js --screenshots ./
--screenshots
is considered as an option ofnf
iso.testcafe
.I believe the original foreman fixes this by only considering options directly following the
run
parameter.