Skip to content

Commit f7e26fa

Browse files
committed
suppress stack trace on invalid argument
1 parent 9641d95 commit f7e26fa

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

EncryptedConfigValue.Cli/Program.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,15 @@ static async Task Main(string[] args)
1010
app.HelpOption("-?|-h|--help");
1111
app.AddSubcommand(new GenerateKeyCommand());
1212
app.AddSubcommand(new EncryptConfigValueCommand());
13-
await app.ExecuteAsync(args);
13+
try
14+
{
15+
await app.ExecuteAsync(args);
16+
}
17+
catch (CommandParsingException ex)
18+
{
19+
Console.Error.WriteLine($"Error: {ex.Message}");
20+
Environment.ExitCode = 1;
21+
}
1422
}
1523
}
1624
}

0 commit comments

Comments
 (0)