Skip to content

Improve error display when there are invalid command line parameters#1004

Open
normj wants to merge 1 commit into
devfrom
normj/improve-parameter-parse-error
Open

Improve error display when there are invalid command line parameters#1004
normj wants to merge 1 commit into
devfrom
normj/improve-parameter-parse-error

Conversation

@normj
Copy link
Copy Markdown
Member

@normj normj commented Apr 11, 2026

Issue #, if available:
#1001

Description of changes:
Improve the error output to avoid dumping a stacktrace if there is a user error of an invalid command line parameter.

Before

> dotnet run -- help
Using launch settings from C:\codebase\aws-dotnet-deploy\src\AWS.Deploy.CLI\Properties\launchSettings.json...
AWS .NET deployment tool for deploying .NET Core applications to AWS.
Project Home: https://github.com/aws/aws-dotnet-deploy

Unhandled exception.  This is a bug.  Please copy the stack trace below and file a bug at https://github.com/aws/aws-dotnet-deploy.
Unknown command 'help'.
   at Spectre.Console.Cli.CommandTreeParser.ParseString(CommandTreeParserContext context, CommandTreeTokenStream stream, CommandTree node) in /_/src/Spectre.Console.Cli/Internal/Parsing/CommandTreeParser.cs:line 209
   at Spectre.Console.Cli.CommandTreeParser.ParseCommandParameters(CommandTreeParserContext context, CommandInfo command, CommandTree parent, CommandTreeTokenStream stream) in /_/src/Spectre.Console.Cli/Internal/Parsing/CommandTreeParser.cs:line 157
   at Spectre.Console.Cli.CommandTreeParser.Parse(CommandTreeParserContext context, CommandTreeTokenizerResult tokenizerResult) in /_/src/Spectre.Console.Cli/Internal/Parsing/CommandTreeParser.cs:line 82
   at Spectre.Console.Cli.CommandExecutor.InternalParseCommandLineArguments(CommandModel model, CommandAppSettings settings, IReadOnlyList`1 args) in /_/src/Spectre.Console.Cli/Internal/CommandExecutor.cs:line 213
   at Spectre.Console.Cli.CommandExecutor.ParseCommandLineArguments(CommandModel model, CommandAppSettings settings, IReadOnlyList`1 args) in /_/src/Spectre.Console.Cli/Internal/CommandExecutor.cs:line 133
   at Spectre.Console.Cli.CommandExecutor.Execute(IConfiguration configuration, IEnumerable`1 args) in /_/src/Spectre.Console.Cli/Internal/CommandExecutor.cs:line 74
   at Spectre.Console.Cli.CommandApp.RunAsync(IEnumerable`1 args) in /_/src/Spectre.Console.Cli/CommandApp.cs:line 87

After

> dotnet run -- help
Using launch settings from C:\codebase\aws-dotnet-deploy\src\AWS.Deploy.CLI\Properties\launchSettings.json...
AWS .NET deployment tool for deploying .NET Core applications to AWS.
Project Home: https://github.com/aws/aws-dotnet-deploy

Unknown command 'help'.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 11, 2026

Codecov Report

❌ Patch coverage is 0% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 35.04%. Comparing base (fb656d3) to head (7774dc0).
⚠️ Report is 8 commits behind head on dev.

Files with missing lines Patch % Lines
src/AWS.Deploy.CLI/App.cs 0.00% 5 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##              dev    #1004       +/-   ##
===========================================
- Coverage   62.11%   35.04%   -27.08%     
===========================================
  Files         294      294               
  Lines       10813    10818        +5     
  Branches     1615     1616        +1     
===========================================
- Hits         6717     3791     -2926     
- Misses       3494     6681     +3187     
+ Partials      602      346      -256     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@GarrettBeatty GarrettBeatty force-pushed the normj/improve-parameter-parse-error branch from 0fe0b36 to 7774dc0 Compare April 29, 2026 21:31
@GarrettBeatty GarrettBeatty requested review from a team as code owners April 29, 2026 21:31
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.

3 participants