Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Review CLI #364
We need to think if current CLI is how it is should be done, or maybe it is better to have multiple parsers having parameters for specific targets (generate, build, etc).
We currently use argparse, maybe it would be worth to check other framework?
Useful to read:
Jan 24, 2019
This was referenced
Feb 12, 2019
The biggest issue in designing a nice CLI for CEKit is that we chain commands; the build phase requires generate phase to finish first. When you build the image using
Even more, a specific build option can even influence how the generate phase is executed, as an example we have the OSBS build engine which influences how the generate phase generate files. These are different from what would be generated when executed for a Docker build engine.
One option would be to hide the generate phase and do not expose it at all to the CLI. This would result in a very clean CLI where only two commands would be available: build and test.
On the other hand it's very handy to have the generate phase exposed to to investigate the generated files without the need to build the image.
Considering all above I think the best option would be to:
I've played with a stub and here is the help output and some examples. Feedback welcome.
Please note that I haven't investigated if the options are still useful or not, this is just a conversion of the current CLI.
Looks good to me, I only use generate to test cekit is mostly working from time to time, and --dry-run seem to cover that.
One question, does cekit test also imply build? I can't see how it could, since you have a bunch of other build options to specify (osbs etc etc). But just wondering if it has a default?
Thanks for the comment. No, the
Potentially we could build the image if
Maybe the solution would be to have two endpoints/binaries:
I started playing with the CLI documentation a bit and here is a preview:
I think it's nice to have something like this.