Command-line parsing that matches Kaocha's runner.
The flag table mirrors kaocha.runner/cli-options plus the options added by
Kaocha's default plugins (filter, randomize, capture-output), the harmless
profiling/notifier flags, and volley's own --workers, --isolate and
--runtime and --aliases. Tokenising follows clojure.tools.cli/parse-opts as Kaocha
calls it: options and positional arguments may be interleaved, -- ends
option parsing, --opt=value works for options that take a value, and
--[no-]flag toggles. Parsing never throws; problems become :errors.
Command-line parsing that matches Kaocha's runner. The flag table mirrors `kaocha.runner/cli-options` plus the options added by Kaocha's default plugins (filter, randomize, capture-output), the harmless profiling/notifier flags, and volley's own `--workers`, `--isolate` and `--runtime` and `--aliases`. Tokenising follows `clojure.tools.cli/parse-opts` as Kaocha calls it: options and positional arguments may be interleaved, `--` ends option parsing, `--opt=value` works for options that take a value, and `--[no-]flag` toggles. Parsing never throws; problems become `:errors`.
(help-text invocation)Usage text for --help, in the shape of Kaocha's own, with plugin
options and volley's own under headings. invocation is how volley was
run (volley.runtime/invocation).
Usage text for `--help`, in the shape of Kaocha's own, with plugin options and volley's own under headings. `invocation` is how volley was run (`volley.runtime/invocation`).
(parse-args argv)Parse argv (a seq of strings) the way Kaocha's runner does.
Returns {:options {...} :suites [kw ...] :errors [str ...]}. Option keys
follow tools.cli: --no-color gives {:color false}, repeatable options
(--focus, --skip, --focus-meta, --skip-meta, --reporter,
--plugin) collect into vectors, and :config-file defaults to
"tests.edn". Positional arguments are suite ids, with an optional leading
colon. Never throws.
Parse `argv` (a seq of strings) the way Kaocha's runner does.
Returns `{:options {...} :suites [kw ...] :errors [str ...]}`. Option keys
follow tools.cli: `--no-color` gives `{:color false}`, repeatable options
(`--focus`, `--skip`, `--focus-meta`, `--skip-meta`, `--reporter`,
`--plugin`) collect into vectors, and `:config-file` defaults to
"tests.edn". Positional arguments are suite ids, with an optional leading
colon. Never throws.(plugin-flag-errors options plugins)Kaocha only knows a plugin's flags when the plugin is loaded, and rejects
them otherwise ("Unknown option", exit -1). options are parsed
options, plugins the normalized plugin keywords of the config. Returns
the errors for flags whose plugin is not listed.
Kaocha only knows a plugin's flags when the plugin is loaded, and rejects
them otherwise ("Unknown option", exit -1). `options` are parsed
options, `plugins` the normalized plugin keywords of the config. Returns
the errors for flags whose plugin is not listed.cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |