-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
4.0: Rethinking CLI-based configuration #94
Milestone
Comments
about-code
added a commit
that referenced
this issue
May 30, 2020
BREAKING CHANGE: Command Line Interface (CLI) changed (#94). From the old set of arguments only `--config` and `--help` remain supported. `--config` is now *required*. Any other configuration options are being replaced by two new options `--shallow` and `--deep` which take a JSON string that is expected to match the configuration schema. As you may suggest from their names you can use them to merge a command-line provided configuration with the configuration provided in the configuration file. Use those two options if you need to override particular configuration keys in a configuration file on a particular program execution. For example if you previously wrote ~~~ glossarify-md --config ./glossarify-md.conf.json --baseUrl "http://example.org" ~~~ you now write ~~~ glossarify-md --config ./glossarify-md.conf.json --shallow '{ "baseUrl": "http://example.org" }' ~~~ If you need to add another glossarify file write ~~~ glossarify-md --config ./glossarify-md.conf.json --deep '{ "glossaries": [{ "file": "./glossary2.md" }] }' ~~~ Closes #93 and #94.
about-code
added a commit
that referenced
this issue
Aug 11, 2020
BREAKING CHANGE: Command Line Interface (CLI) changed (#94). From the old set of arguments only `--config` and `--help` remain supported. `--config` is now *required*. Any other configuration options are being replaced by two new options `--shallow` and `--deep` which take a JSON string that is expected to match the configuration schema. As you may suggest from their names you can use them to merge a command-line provided configuration with the configuration provided in the configuration file. Use those two options if you need to override particular configuration keys in a configuration file on a particular program execution. For example if you previously wrote ~~~ glossarify-md --config ./glossarify-md.conf.json --baseUrl "http://example.org" ~~~ you now write ~~~ glossarify-md --config ./glossarify-md.conf.json --shallow '{ "baseUrl": "http://example.org" }' ~~~ If you need to add another glossarify file write ~~~ glossarify-md --config ./glossarify-md.conf.json --deep '{ "glossaries": [{ "file": "./glossary2.md" }] }' ~~~ Closes #93 and #94.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The configuration schema grew complex and mapping it to individual CLI arguments makes the CLI difficult to understand and use. Rather than trying to map a complex configuration schema to command line options an easier interface were to provide only two options for merging a JSON string configuration with a file configuration:
For example:
replaces the a
glossaries: [...]
array in the configuration file for that particular executionadds a new entry to
glossaries: [...]
array in the configuration file for that particular execution.The text was updated successfully, but these errors were encountered: