From 7774dc0d694f8e269d3677cb4bcb811109e7366e Mon Sep 17 00:00:00 2001 From: Norm Johanson Date: Fri, 10 Apr 2026 17:40:07 -0700 Subject: [PATCH] Improve error display when there are invalid command line parameters --- .../changes/36545244-0ca6-4153-ae65-68ff655b5caf.json | 11 +++++++++++ src/AWS.Deploy.CLI/App.cs | 5 +++++ 2 files changed, 16 insertions(+) create mode 100644 .autover/changes/36545244-0ca6-4153-ae65-68ff655b5caf.json diff --git a/.autover/changes/36545244-0ca6-4153-ae65-68ff655b5caf.json b/.autover/changes/36545244-0ca6-4153-ae65-68ff655b5caf.json new file mode 100644 index 00000000..30a0ddab --- /dev/null +++ b/.autover/changes/36545244-0ca6-4153-ae65-68ff655b5caf.json @@ -0,0 +1,11 @@ +{ + "Projects": [ + { + "Name": "AWS.Deploy.CLI", + "Type": "Patch", + "ChangelogMessages": [ + "Improve error display when there are invalid command line parameters" + ] + } + ] +} \ No newline at end of file diff --git a/src/AWS.Deploy.CLI/App.cs b/src/AWS.Deploy.CLI/App.cs index 5af78ea9..12e125d1 100644 --- a/src/AWS.Deploy.CLI/App.cs +++ b/src/AWS.Deploy.CLI/App.cs @@ -61,6 +61,11 @@ public static CommandApp ConfigureServices(TypeRegistrar registrar) // bail out with an non-zero return code. return CommandReturnCodes.USER_ERROR; } + else if (exception is CommandParseException parseException) + { + toolInteractiveService.WriteErrorLine(parseException.Message); + return CommandReturnCodes.USER_ERROR; + } else { // This is a bug