-
-
Notifications
You must be signed in to change notification settings - Fork 66
feat: add engine subcommands to expert #254
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
base: main
Are you sure you want to change the base?
Conversation
set no_return() to run/1
711e699 to
a7a5bdb
Compare
| # Handle engine subcommand first (before starting the LSP server) | ||
| case argv do | ||
| ["engine" | engine_args] -> | ||
| Expert.Engine.run(engine_args) |
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.
Can you make this return the exit code, and put the System.halt(exit_code) part here?
That'll make the unit tests easier to write, as well as pull the halting part up to the top level.
This way it's very clear that the program stops after this code runs.
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.
Will do.
Just a quick question. Would you like it to always return success (0), event though it fails deleting a file?
like if its fails the middle one of 3 files in expert clean --force it will continue after failing, logging something went wrong, and delete the last one and return 0. Or would like it to stop after failing and return 1?
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.
If it fails any, lets return a non zero exit code (1).
| end | ||
|
|
||
| @spec print_help() :: no_return() | ||
| defp print_help do |
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.
Let's also add help text to each subcommand, and the options can be presented for the relevant subcommand.
So in the existing help text here, we won't have any options, and the --force option will show up in the help text for the clean subcommand
closes #209
Taking a stab at the issue. Hoping I understood it correctly.