Open honzajavorek opened 6 years ago
--hooks=...
(files)--hooks-handler=...
(binary path or keyword like python
, js
, js-sandbox
)--sandbox
in favor of the -sandbox
suffix (see above)js
, nodejs
, and javascript
are aliases--hooks-handler
value default is detected from the --hooks
value (extensions) or set to JavaScript, so most of the time the option isn't needed at allcustom
allows for https://github.com/apiaryio/dredd/issues/755, doesn't spawn anything, but sends the data to given hook handler host and port (prints out where it's sending the data... could do this always anyway)--hooks-worker-*
to --hooks-handler-*
--server=...
(binary path)l
, q
, etc.), use full option names instead (may require migration to another CLI commands handler than optimist)
This is a proposal on how to tackle the dredd init + dredd.yml epic.
Parts of Dredd affected
Requirements
dredd init
dredd init
--names
https://github.com/apiaryio/dredd/issues/563Solutions
New CLI
Clearly distinguish commands, arguments, and options. Notes:
dredd init
,--config
indicates where to save the file,--init
doesn't exist, remove-i
dredd names <api description filename - or - url> <api description filename - or - url> ...
(formerly--names
)dredd <api description filename - or - url> <server url>
dredd <api description filename - or - url - or apiary subdomain/url> <server url>
overrides thedredd.yml
valuesdredd --api-description=...
overrides thedredd.yml
value--api-description=...
is instead of--path
dredd --server-url=...
overrides thedredd.yml
valuedredd --version
=dredd version
(alias)dredd --help
is command-specific, e.g.dredd names --help
dredd --hookfiles=
changes todredd --hooks=
--language
is not required if it can be detected from--hooks=
files extensions, otherwise there should be aliases (python = python-dredd-hooks binary etc.) or it is treated as a custom hooks handler (works now, but not documented)--language
is resolved asnodejs
orjavascript
orjs
, otherwise it should fail--server-wait
without--server
--details, -d
does and whether anyone uses itDownloading API description from Apiary
-j/--custom
with custom configuration andapiaryApiName
withapiaryApiKey
properties, whereapiaryApiName
is a unique identifier of the API project in Apiary--custom
completely to user-specific stuff and pass it on to hooks (see https://github.com/apiaryio/dredd/commit/7bffde7be6fcaf7c96cf114751dc5fde02b86ac4#r29826481) - https://github.com/apiaryio/dredd/issues/215Dredd could accept the identifier instead of the API description file name or URL:this is dangerous and non-deterministic and we would hate ourselves for such design decisiondredd myapi http://localhost:4000
--apiary-api-name
--apiary-api-key
option instead ofapiaryApiKey
and acceptAPIARY_API_KEY=
env var as well (to work together with the Apiary CLI)$ dredd init --apiary-api-name=myapi --apiary-api-key=9a5.... --reporter=apiary