feat!: show-config is now a command, slight refactor #74
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What was the problem/requirement? (What/Why)
When implementing #73 I discovered that the entrypoint was a bit hard to grasp, and that adding new commands didn't fit very well. Also various bugs and documentation missing.
What was the solution? (How)
This PR accomplishes several things:
start()
method in the entry point from 130 LOC to 27__init__
implementations inAdaptor
subclasses in testsIntegCommandAdaptor
if the arguments passed in are not stringsIntegManagerProcessed
whereget_arguments
return a string instread of a listhelp
text to some commands where it didn't exist priorsubcommands
parser to be titledcommands
--show-config
argument to it's ownshow-config
command since it doesn't play nice with other commands anyway_parse_args
in unit tests, instead mocksys.argv
so we can guarantee it works as expected, and the tests aren't brittle to adding a new command in the future.run
command.What is the impact of this change?
The help text is a bit more clear
Examples with the
IntegCommandAdaptor
Old:
New:
The interface of the CLI has changed for
--show-config
.Old:
New:
Adaptors no long run the
run
command when provided no command. This was broken anyway becauseinit-data
andrun-data
couldn't be passed in due to how we construct the argparser.Old:
New:
How was this change tested?
Manual testing depicted above, unit/integ tests pass.
Was this change documented?
?
Is this a breaking change?
Yes
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.