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

Report error when option not found #24

Closed
inech opened this issue Sep 6, 2019 · 4 comments
Closed

Report error when option not found #24

inech opened this issue Sep 6, 2019 · 4 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@inech
Copy link
Contributor

inech commented Sep 6, 2019

It would be nice to report an error to a user when he/she specifies an unknown option.

Actual
Let's say there is an optional option error-output. You run a command:

validate file --file C:\mydir\123.txt --schema C:\mydir\123.schema --errors-output C:\mydir\results

And for some reason, it doesn't behave as expected even though you don't see any errors.

Expected
You run this command and it tells you that option errors-output doesn't exist. You quickly fix the typo.

@Tyrrrz Tyrrrz added the enhancement New feature or request label Sep 6, 2019
@Tyrrrz
Copy link
Owner

Tyrrrz commented Jan 27, 2020

Related to #38.

@Tyrrrz Tyrrrz added the good first issue Good for newcomers label Jan 27, 2020
@Tyrrrz Tyrrrz closed this as completed in c854f5f Mar 16, 2020
@YizhixiaoMoJun
Copy link

could we let the consumer decide if we should ignore the unknown option or throw an exception, something like ApplicationBuilder.IgnoreUnknownOption() ? The unknown option is useful, especially when working with Microsoft.Extensions.Configuration.CommandLine, we would have a flexible way to let user set additional configurations.

@Tyrrrz
Copy link
Owner

Tyrrrz commented Aug 12, 2021

could we let the consumer decide if we should ignore the unknown option or throw an exception, something like ApplicationBuilder.IgnoreUnknownOption() ? The unknown option is useful, especially when working with Microsoft.Extensions.Configuration.CommandLine, we would have a flexible way to let user set additional configurations.

Do you mean when you need to pass additional arguments to the underlying CLI or something like that? Would #39 be closer to what you need?

@YizhixiaoMoJun
Copy link

could we let the consumer decide if we should ignore the unknown option or throw an exception, something like ApplicationBuilder.IgnoreUnknownOption() ? The unknown option is useful, especially when working with Microsoft.Extensions.Configuration.CommandLine, we would have a flexible way to let user set additional configurations.

Do you mean when you need to pass additional arguments to the underlying CLI or something like that? Would #39 be closer to what you need?

yes, something like that 😄.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants