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

Added warning in case of invalid combination of command and flags and/or arguments #1781

Merged
merged 5 commits into from
Apr 11, 2022
Merged

Added warning in case of invalid combination of command and flags and/or arguments #1781

merged 5 commits into from
Apr 11, 2022

Conversation

ruvceskistefan
Copy link
Contributor

Closes #1731

@ruvceskistefan ruvceskistefan requested a review from a team as a code owner March 24, 2022 15:16
}
}

[Theory]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Love the tests!

[Constants.Runner.CommandLine.Commands.Remove] =
new string[]
{
Constants.Runner.CommandLine.Args.Token
Copy link
Member

Choose a reason for hiding this comment

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

do we need to add PAT to the Remove list?

Copy link
Collaborator

Choose a reason for hiding this comment

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

we should!

@thboop
Copy link
Collaborator

thboop commented Apr 11, 2022

Could we update the error message to provide more context.

  1. If we can easily get the name of the command being run (or at least the first command if there are multiple we could do
terminal.WriteError($"Unrecognized command-line input arguments for command ${command}: '{string.Join(", ", unknownCommandlines)}'. For usage refer to: .\\config.cmd --help or ./config.sh --help");
  1. I don't see an easy way to get the the command name in program.cs , so we could also:
terminal.WriteError($"This command does not recognize the command-line input arguments: '{string.Join(", ", unknownCommandlines)}'. For usage refer to: .\\config.cmd --help or ./config.sh --help");

@ruvceskistefan
Copy link
Contributor Author

Could we update the error message to provide more context.

  1. If we can easily get the name of the command being run (or at least the first command if there are multiple we could do
terminal.WriteError($"Unrecognized command-line input arguments for command ${command}: '{string.Join(", ", unknownCommandlines)}'. For usage refer to: .\\config.cmd --help or ./config.sh --help");
  1. I don't see an easy way to get the the command name in program.cs , so we could also:
terminal.WriteError($"This command does not recognize the command-line input arguments: '{string.Join(", ", unknownCommandlines)}'. For usage refer to: .\\config.cmd --help or ./config.sh --help");

I can implement a method in the CommandSettings class that will return the command's name based on the flags Configure, Remove, Run, and Warmup, and then use that method in Program.cs.

Copy link
Collaborator

@thboop thboop left a comment

Choose a reason for hiding this comment

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

lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Runner should warn if wrong flags are passed to the runner
3 participants