Adjust and document exit codes#4787
Conversation
vlada-shubina
left a comment
There was a problem hiding this comment.
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.
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.
vlada-shubina
left a comment
There was a problem hiding this comment.
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 enableto all the modified files ?