Simplify the argparser setup in testflinger-cli#803
Simplify the argparser setup in testflinger-cli#803plars wants to merge 1 commit intocanonical:mainfrom
Conversation
There's a lot of boilerplate and extra functions needed to setup argparse, due to all the subcommands and different args needed. This allows us to define them up front in a JSON blob that gets used to setup argparse.
|
@pedro-avalos @boukeas @val500 Tagging you hear because it doesn't seem to auto-assign reviewers when someone from the outisde submits a PR, so it probably didn't notify you at all. I have this one and another at #804 if you get a chance to take a look. :) |
|
I would like to see tests that go along with something like this as every argument is being touched. With no supporting documentation as to how they relate or will be parsed. |
|
This would also need to be updated to include the current state of args in testflinger CLI, the json is missing the admin stuff at the very least. |
Hello from the dark side! (still looking for those cookies)
I was feeling nostalgic and decided to go tidy some things up. Feel free to take this or not. I'm really happy to see how nicely everything seems to still be progressing with this project! :)
Description
There's a lot of boilerplate and extra functions needed to setup argparse, due to all the subcommands and different args needed. This allows us to define them up front in a JSON blob that gets used to setup argparse.
Resolved issues
Mainly it just makes it easier to read and modify, and removes a lot of boilerplate as mentioned above.
Documentation
N/A
Web service API changes
N/A
Tests
The tests all still pass, and to be clear, this doesn't intend to change the way the cli args work at all. It just cleans it up a bit and makes it easier to work with.