Add command-line arguments to configure the TCK (instead of environment variables)
As described in #6 (closed) we will need to support a client-server mode.
For this purpose, the TCK will need to support additional arguments (such as the command to start/stop the server or the target server's URL).
Currently, we use an environment variable to pass the path to the CLI adapter. To avoid having a multitude of environment variables and simplify the configuration, I think we could add command-line arguments to the TCK.
Luckily, recent versions of Node.js can use util.parseArgs
to parse command-line arguments (https://nodejs.org/api/util.html#utilparseargsconfig) so we won't need to use a third-party library.
As I explained in this comment: #6 (comment 1156320), here is what I propose:
$ asciidoc-tck server --start-command=/path/to/start-server --stop-command=/path/to/stop-server --url=https://localhost:8081/asciidoc-tck-adapter
-
--start-command
or--url
must be defined. -
--url
is optional, if missing use the value returned by--start-command
. -
--start-command
is optional, if missing use the--url
value. -
--stop-command
is optional.
NOTE: If both, --start-command
and --url
are defined, I think we should execute the start command but use the value of the specified URL (rather than the value returned by the start command)?
$ asciidoc-tck cli --command=/path/to/adapter-thus-runs-standalone
-
--command
is mandatory
We could also support shorthand commands:
# shorthand
$ asciidoc-tck cli /path/to/adapter-thus-runs-standalone
$ asciidoc-tck /path/to/adapter-thus-runs-standalone