Skip to content
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

Fixes providing value for required option. Closes #6518 #6520

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

waldekmastykarz
Copy link
Member

Fixes providing value for required option. Closes #6518

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (1)

src/cli/cli.ts:201

  • Ensure that the new behavior introduced by the getCommandOptionsFromArgs function is covered by tests to verify correct parsing and coercion of the answer.
const parsed = getCommandOptionsFromArgs([`--${optionName}`, answer], cli.commandToExecute);
@milanholemans milanholemans self-assigned this Dec 16, 2024
Copy link
Contributor

@milanholemans milanholemans left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's working great. Although I found a small issue. When a boolean option is required, as mentioned in the issue, the CLI prompts for a value if it's not passed. However, I've noticed that if you just press enter, and thus not providing a value, you are getting an uncaught exception.

image

This behavior does not happen when you type the required option as number or string, only when it's typed as boolean. Maybe we should just use a default value just like we do for other option types.

@milanholemans milanholemans marked this pull request as draft December 16, 2024 23:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug report: Cannot provide value for the missing parameter
2 participants