Skip to content

Commit

Permalink
(GH-1758)(doc) provide exit code docs
Browse files Browse the repository at this point in the history
Add exit code documentation to all of the commands.
  • Loading branch information
ferventcoder committed Mar 14, 2019
1 parent a9999c7 commit 3c5afc5
Show file tree
Hide file tree
Showing 14 changed files with 269 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,19 @@ choco apikey -k <your key here> -s {0}
".format_with(ApplicationParameters.ChocolateyCommunityFeedPushSource));

"chocolatey".Log().Info(ChocolateyLoggers.Important, "Exit Codes");
"chocolatey".Log().Info(@"
Exit codes that normally result from running this command.
Normal:
- 0: operation was successful, no issues detected
- -1 or 1: an error has occurred
If you find other exit codes that we have not yet documented, please
file a ticket so we can document it at
https://github.com/chocolatey/choco/issues/new/choose.
");
"chocolatey".Log().Info(ChocolateyLoggers.Important, "Options and Switches");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,21 @@ choco config unset --name proxy
write proper scripts and integrations.
");

"chocolatey".Log().Info(ChocolateyLoggers.Important, "Exit Codes");
"chocolatey".Log().Info(@"
Exit codes that normally result from running this command.
Normal:
- 0: operation was successful, no issues detected
- -1 or 1: an error has occurred
If you find other exit codes that we have not yet documented, please
file a ticket so we can document it at
https://github.com/chocolatey/choco/issues/new/choose.
");

"chocolatey".Log().Info(ChocolateyLoggers.Important, "See It In Action");
"chocolatey".Log().Info(@"
Config shown in action: https://raw.githubusercontent.com/wiki/chocolatey/choco/images/gifs/choco_config.gif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,20 @@ choco feature list
NOTE: See scripting in the command reference (`choco -?`) for how to
write proper scripts and integrations.
");

"chocolatey".Log().Info(ChocolateyLoggers.Important, "Exit Codes");
"chocolatey".Log().Info(@"
Exit codes that normally result from running this command.
Normal:
- 0: operation was successful, no issues detected
- -1 or 1: an error has occurred
If you find other exit codes that we have not yet documented, please
file a ticket so we can document it at
https://github.com/chocolatey/choco/issues/new/choose.
");

"chocolatey".Log().Info(ChocolateyLoggers.Important, "Options and Switches");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,28 @@ choco info powershell
write proper scripts and integrations.
");
"chocolatey".Log().Info(ChocolateyLoggers.Important, "Exit Codes");
"chocolatey".Log().Info(@"
Exit codes that normally result from running this command.
Normal:
- 0: operation was successful, no issues detected
- -1 or 1: an error has occurred
Enhanced:
- 0: operation was successful, no issues detected
- -1 or 1: an error has occurred
- 2: no results (enhanced)
NOTE: Starting in v0.10.12, if you have the feature '{0}'
turned on, then choco will provide enhanced exit codes that allow
better integration and scripting.
If you find other exit codes that we have not yet documented, please
file a ticket so we can document it at
https://github.com/chocolatey/choco/issues/new/choose.
".format_with(ApplicationParameters.Features.UseEnhancedExitCodes));
"chocolatey".Log().Info(ChocolateyLoggers.Important, "Options and Switches");
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,35 @@ go modify Path to just one Ruby and then use something like uru
write proper scripts and integrations.
");

"chocolatey".Log().Info(ChocolateyLoggers.Important, "Exit Codes");
"chocolatey".Log().Info(@"
Exit codes that normally result from running this command.
Normal:
- 0: operation was successful, no issues detected
- -1 or 1: an error has occurred
Package Exit Codes:
- 1641: success, reboot initiated
- 3010: success, reboot required
- other (not listed): likely an error has occurred
In addition to normal exit codes, packages are allowed to exit
with their own codes when the feature '{0}' is
turned on. Uninstall command has additional valid exit codes.
Available in v0.9.10+.
Reboot Exit Codes:
- 350: pending reboot detected, no action has occurred
- 1604: install suspended, incomplete
In addition to the above exit codes, you may also see reboot exit codes
when the feature '{1}' is turned on. It typically requires
the feature '{0}' to also be turned on to work properly.
Available in v0.10.12+.
".format_with(ApplicationParameters.Features.UsePackageExitCodes, ApplicationParameters.Features.ExitOnRebootDetected));

"chocolatey".Log().Info(ChocolateyLoggers.Important, "See It In Action");
"chocolatey".Log().Info(@"
Chocolatey FOSS install showing tab completion and `refreshenv` (a way
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,30 @@ choco search git
write proper scripts and integrations.
");

"chocolatey".Log().Info(ChocolateyLoggers.Important, "Exit Codes");
"chocolatey".Log().Info(@"
Exit codes that normally result from running this command.
Normal:
- 0: operation was successful, no issues detected
- -1 or 1: an error has occurred
Enhanced:
- 0: operation was successful, no issues detected
- -1 or 1: an error has occurred
- 2: no results (enhanced)
NOTE: Starting in v0.10.12, if you have the feature '{0}'
turned on, then choco will provide enhanced exit codes that allow
better integration and scripting.
If you find other exit codes that we have not yet documented, please
file a ticket so we can document it at
https://github.com/chocolatey/choco/issues/new/choose.
".format_with(ApplicationParameters.Features.UseEnhancedExitCodes));

"chocolatey".Log().Info(ChocolateyLoggers.Important, "See It In Action");
"chocolatey".Log().Info(@"
choco search: https://raw.githubusercontent.com/wiki/chocolatey/choco/images/gifs/choco_search.gif
Expand Down
14 changes: 14 additions & 0 deletions src/chocolatey/infrastructure.app/commands/ChocolateyNewCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,20 @@ This is called automatic recompile.
NOTE: See scripting in the command reference (`choco -?`) for how to
write proper scripts and integrations.
");

"chocolatey".Log().Info(ChocolateyLoggers.Important, "Exit Codes");
"chocolatey".Log().Info(@"
Exit codes that normally result from running this command.
Normal:
- 0: operation was successful, no issues detected
- -1 or 1: an error has occurred
If you find other exit codes that we have not yet documented, please
file a ticket so we can document it at
https://github.com/chocolatey/choco/issues/new/choose.
");

"chocolatey".Log().Info(ChocolateyLoggers.Important, "Options and Switches");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,30 @@ you may want to add `--ignore-unfound` to your options.
write proper scripts and integrations.
");

"chocolatey".Log().Info(ChocolateyLoggers.Important, "Exit Codes");
"chocolatey".Log().Info(@"
Exit codes that normally result from running this command.
Normal:
- 0: operation was successful, no issues detected
- -1 or 1: an error has occurred
Enhanced:
- 0: no outdated packages
- -1 or 1: an error has occurred
- 2: outdated packages have been found
NOTE: Starting in v0.10.12, if you have the feature '{0}'
turned on, then choco will provide enhanced exit codes that allow
better integration and scripting.
If you find other exit codes that we have not yet documented, please
file a ticket so we can document it at
https://github.com/chocolatey/choco/issues/new/choose.
".format_with(ApplicationParameters.Features.UseEnhancedExitCodes));

"chocolatey".Log().Info(ChocolateyLoggers.Important, "See It In Action");
"chocolatey".Log().Info(@"
choco outdated: https://raw.githubusercontent.com/wiki/chocolatey/choco/images/gifs/choco_outdated.gif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,20 @@ choco pack --outputdirectory build
NOTE: See scripting in the command reference (`choco -?`) for how to
write proper scripts and integrations.
");

"chocolatey".Log().Info(ChocolateyLoggers.Important, "Exit Codes");
"chocolatey".Log().Info(@"
Exit codes that normally result from running this command.
Normal:
- 0: operation was successful, no issues detected
- -1 or 1: an error has occurred
If you find other exit codes that we have not yet documented, please
file a ticket so we can document it at
https://github.com/chocolatey/choco/issues/new/choose.
");

"chocolatey".Log().Info(ChocolateyLoggers.Important, "Options and Switches");
Expand Down
14 changes: 14 additions & 0 deletions src/chocolatey/infrastructure.app/commands/ChocolateyPinCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,20 @@ choco pin remove --name git
NOTE: See scripting in the command reference (`choco -?`) for how to
write proper scripts and integrations.
");

"chocolatey".Log().Info(ChocolateyLoggers.Important, "Exit Codes");
"chocolatey".Log().Info(@"
Exit codes that normally result from running this command.
Normal:
- 0: operation was successful, no issues detected
- -1 or 1: an error has occurred
If you find other exit codes that we have not yet documented, please
file a ticket so we can document it at
https://github.com/chocolatey/choco/issues/new/choose.
");

"chocolatey".Log().Info(ChocolateyLoggers.Important, "Options and Switches");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,20 @@ You can verify by going to {0}packages/packageName.
and you don't see a good reason for it.
".format_with(ApplicationParameters.ChocolateyCommunityFeedPushSource));

"chocolatey".Log().Info(ChocolateyLoggers.Important, "Exit Codes");
"chocolatey".Log().Info(@"
Exit codes that normally result from running this command.
Normal:
- 0: operation was successful, no issues detected
- -1 or 1: an error has occurred
If you find other exit codes that we have not yet documented, please
file a ticket so we can document it at
https://github.com/chocolatey/choco/issues/new/choose.
");

"chocolatey".Log().Info(ChocolateyLoggers.Important, "Options and Switches");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,20 @@ choco source list
NOTE: See scripting in the command reference (`choco -?`) for how to
write proper scripts and integrations.
");

"chocolatey".Log().Info(ChocolateyLoggers.Important, "Exit Codes");
"chocolatey".Log().Info(@"
Exit codes that normally result from running this command.
Normal:
- 0: operation was successful, no issues detected
- -1 or 1: an error has occurred
If you find other exit codes that we have not yet documented, please
file a ticket so we can document it at
https://github.com/chocolatey/choco/issues/new/choose.
");

"chocolatey".Log().Info(ChocolateyLoggers.Important, "Options and Switches");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,35 @@ write proper scripts and integrations.
");

"chocolatey".Log().Info(ChocolateyLoggers.Important, "Exit Codes");
"chocolatey".Log().Info(@"
Exit codes that normally result from running this command.
Normal:
- 0: operation was successful, no issues detected
- -1 or 1: an error has occurred
Package Exit Codes:
- 1605: software is not installed
- 1614: product is uninstalled
- 1641: success, reboot initiated
- 3010: success, reboot required
- other (not listed): likely an error has occurred
In addition to normal exit codes, packages are allowed to exit
with their own codes when the feature '{0}' is
turned on. Available in v0.9.10+.
Reboot Exit Codes:
- 350: pending reboot detected, no action has occurred
- 1604: install suspended, incomplete
In addition to the above exit codes, you may also see reboot exit codes
when the feature '{1}' is turned on. It typically requires
the feature '{0}' to also be turned on to work properly.
Available in v0.10.12+.
".format_with(ApplicationParameters.Features.UsePackageExitCodes, ApplicationParameters.Features.ExitOnRebootDetected));

"chocolatey".Log().Info(ChocolateyLoggers.Important, "Options and Switches");
"chocolatey".Log().Info(@"
NOTE: Options and switches apply to all items passed, so if you are
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,35 @@ choco upgrade all
write proper scripts and integrations.
");

"chocolatey".Log().Info(ChocolateyLoggers.Important, "Exit Codes");
"chocolatey".Log().Info(@"
Exit codes that normally result from running this command.
Normal:
- 0: operation was successful, no issues detected
- -1 or 1: an error has occurred
Package Exit Codes:
- 1641: success, reboot initiated
- 3010: success, reboot required
- other (not listed): likely an error has occurred
In addition to normal exit codes, packages are allowed to exit
with their own codes when the feature '{0}' is
turned on. Uninstall command has additional valid exit codes.
Available in v0.9.10+.
Reboot Exit Codes:
- 350: pending reboot detected, no action has occurred
- 1604: install suspended, incomplete
In addition to the above exit codes, you may also see reboot exit codes
when the feature '{1}' is turned on. It typically requires
the feature '{0}' to also be turned on to work properly.
Available in v0.10.12+.
".format_with(ApplicationParameters.Features.UsePackageExitCodes, ApplicationParameters.Features.ExitOnRebootDetected));

"chocolatey".Log().Info(ChocolateyLoggers.Important, "See It In Action");
"chocolatey".Log().Info(@"
choco upgrade: https://raw.githubusercontent.com/wiki/chocolatey/choco/images/gifs/choco_upgrade.gif
Expand Down

0 comments on commit 3c5afc5

Please sign in to comment.