-
Notifications
You must be signed in to change notification settings - Fork 390
Adjust and document exit codes #4787
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please consider also parsing errors in exit codes, feels like 102 and 103 may be merged.
templating/src/Microsoft.TemplateEngine.Cli/TemplatePackageCoordinator.cs Lines 714 to 840 in 7137e04
Template package failure may be one of the following. Just wondering if different codes make sense here. |
Makes sense - I distinguished It would be great if we could distinguish retriable from nonretriable errors by exit codes - unfortunately the |
``` | ||
|
||
|
||
## <a name="102"></a>102 - Missing required option(s) and/or argument(s) for the command |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'm still not convinced here. For example below, the command misses required argument, and exit code is 127; as it is managed by parser.
PS > dotnet new install
Required argument missing for command: install
Description:
Installs a template package.
Usage:
dotnet new install [<package>...] [options]
Arguments:
<package> NuGet package ID or path to folder or NuGet package to install.
To install the NuGet package of certain version, use <package ID>::<version>.
Options:
--interactive Allows the command to stop and wait for user input or action (for
example to complete authentication).
--add-source, --nuget-source <nuget-source> Specifies a NuGet source to use during install.
--force Allows installing template packages from the specified sources even if
they would override a template package from another source.
-?, -h, --help Show command line help.
PS > $LASTEXITCODE
127
Search command validation should be moved as the validator. I can work on it next month in scope of parser migration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
Still not too convinced about keeping 102
for now, but i believe we can adjust later on if needed.
Problem
Fixes #3186
Fixes #4253
Solution
NewCommandStatus
, fixed some of the controversial usagesChecks: N/A
#nullable enable
to all the modified files ?