What's the best structure for the qlever control script? #21
Replies: 2 comments 1 reply
-
Arguments for the first approach:
in addition, Argument for the second approach:let's take I believe the git (and docker) designed in this manner because each action contains ALOT of flags and they can easily conflict with each other and some of them share the same alias. case in point: doing that in python requires the definition of subparsers which is of course possible and even allows for custom help for each action: My 2 centsproviding a port number when indexing qlever-control has about around dozen flags. using the second approach for will require multiple tldr;
|
Beta Was this translation helpful? Give feedback.
-
For what it's worth, I personally prefer the second approach as it's more consistent with other tools and doesn't require learning any new "chaining" syntax. Anyone can see Also, is it actually that useful to support arbitrary chaining? For example nobody is going to run |
Beta Was this translation helpful? Give feedback.
-
@bradenmacdonald @Goblin80 @Qup42 @joka921 @LorenzBuehmann @lehmann-4178656ch @patrickbr
As the Python version of the qlever script becomes more mature, I am wondering about the best command structure. I see two general approaches:
Right now, the script supports chains of commands (called "actions"), for example:
qlever get-data index start
. Options can be set via a config file (calledQleverfile
) or via the command line, for exampleqlever server.PORT=1234 start
. Currently, these options can appear anywhere in the sequence and are activated at exactly the point where they appear, but that is a detail.Having such sequences looks nice and easy, but it's not very common for other command-line tools. For example,
git
anddocker
have a single-command structure with options, for examplegit add --update
orgit commit
. If you want to chain actions, you can define your own alias in the.gitconfig
in your home directory, for example[alias] ac = !git add --update && git commit
.Which of the two approaches should we take?
Beta Was this translation helpful? Give feedback.
All reactions