Skip to content

Conversation

@rmand97
Copy link

@rmand97 rmand97 commented Dec 11, 2025

closes #209

Taking a stab at the issue. Hoping I understood it correctly.

@rmand97 rmand97 force-pushed the feat/expert-engine-subcommands branch from 711e699 to a7a5bdb Compare December 11, 2025 12:41
# Handle engine subcommand first (before starting the LSP server)
case argv do
["engine" | engine_args] ->
Expert.Engine.run(engine_args)
Copy link
Member

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.

Copy link
Author

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?

Copy link
Member

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
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Clean local engine build

3 participants