-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make all wasp cli commands to use optparse-applicative #1202
Conversation
- We still doesn't handle the command runner yet in this commit.
The commands are supplied externally somewhere! So we don't need to treat running `wasp deploy` alone as error.
Need to implement custom reader for `completion:generate:shell` argument format.
- Replace external commands with locally defined commands. We only import the command parsers from outside the file. - Rename parser to use Parser suffix for consistency. - Rename mkNormalCommand to mkCommand and mkWrapperCommand to mkCommandWithInfo. - Also rename mkCommand and mkCommandWithInfo parameters to adjust with Parser suffix. - Temporarily rename parserSuite to topLevelCommandsParser.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@modotte I reviewed your new changes!
There are some comments you haven't addressed yet, without counting the big one with refactoring that we are leaving for the last.
If you are not sure which ones are still open, go through Conversations
and you should find them.
We are coming close to an end I think, so I would love us to wrap this up and merge it! If any of open comments seems like too much work / troublesome, do pls comments so and we can figure out what to do with it.
I this communicates the intent more clearly.
@Martinsos Hi again. Thx for all the reviews. I've addressed most of the comments including the The last big one (architecture) and the color of the commands (which is probably better in the long-term if solved directly in optparse-applicative) are the major ones that are still left to be solved. |
Awesome @modotte and thanks for this nice summary, it helps a lot with reviewing!
Btw you can freely undraft this PR, it has not been a draft for a long time I think :D. |
Alright! I'll take a look at what I can do in the meantime to get the command colors back again. 🙂 |
I just took a quick look myself -> doesn't feel like much can be done? I continued discussion on the optparse repo, I think the only way through this is that we make a PR there to implement this. |
Since coloring is main thing stopping us from merging this PR, I took a bit of time to play with trying to extend optparse-applicative to support cusotmization of help, here is some very early draft: pcapriotti/optparse-applicative#482 . |
I wouldn't close this one as we are not giving up on it -> it will need updating, and we still need to get stuff done in optparse first, but we will do it at some point. |
Description
This replaces Wasp CLI custom internal parsers with optparse-applicative for consistency. This also adds automatic bash, zsh and fish shell completions.
fixes #773
Command parser coverage progress
new [name] [-t|--template]
version
waspls [--log LOG_FILE] [--stdio]
completion [generate (bash|zsh|fish)]
completion generate shell
format instead ofcompletion:generate:shell
for consistency with the rest of CLI commandsuninstall
start [db]
db (start|reset|seed [name]|studio|migrate-dev [--name migration-name] [--create-only])
compile
wasp start
- see discord messageclean
build
deploy [args]
telemetry
deps
dockerfile
info
test (client) [args]
Misc
db start -t shouldn't pass
.Select what type of change this PR introduces:
Update Waspc ChangeLog and version if needed
If you did a bug fix, new feature, or breaking change, that affects waspc, make sure you satisfy the following: