Swap from YAML Clap CLI to derived struct Clap CLI #161
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.
YAML in Clap has been deprecated and we were two major versions behind. This PR changes the CLI to be derived from a struct and it is much cleaner IMO. We are now on the newest version of Clap which resolves #143.
Before, we had a very flat structure as we had no subcommands, e.g. you could technically supply a query, an input-folder, and give the
-p
argument to start the server at the same time as they were all optional.I personally think this resulted in a very confusing user experience from the terminal, having all arguments be contextually optional is a bit strange as running a single query and starting a server are two very different. It would be nice if they are separate.
In this PR there are two subcommands
serve
andquery
:This is nice because we can avoid a bunch of the optional arguments. E.g. if you are starting a server, you can only supply the ip, port and other relevant arguments, not an input folder and so on:
And we can provide contextual examples for the subcommands without overwhelming the user from the beginning:
If we prefer the flat structure of the CLI from before it is a very quick change, so discuss here what you prefer :)