Skip to content

Commit 3c5afc5

Browse files
committed
(GH-1758)(doc) provide exit code docs
Add exit code documentation to all of the commands.
1 parent a9999c7 commit 3c5afc5

14 files changed

+269
-0
lines changed

src/chocolatey/infrastructure.app/commands/ChocolateyApiKeyCommand.cs

+13
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,19 @@ choco apikey -k <your key here> -s {0}
127127
128128
".format_with(ApplicationParameters.ChocolateyCommunityFeedPushSource));
129129

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

src/chocolatey/infrastructure.app/commands/ChocolateyConfigCommand.cs

+15
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,21 @@ choco config unset --name proxy
120120
write proper scripts and integrations.
121121
122122
");
123+
124+
"chocolatey".Log().Info(ChocolateyLoggers.Important, "Exit Codes");
125+
"chocolatey".Log().Info(@"
126+
Exit codes that normally result from running this command.
127+
128+
Normal:
129+
- 0: operation was successful, no issues detected
130+
- -1 or 1: an error has occurred
131+
132+
If you find other exit codes that we have not yet documented, please
133+
file a ticket so we can document it at
134+
https://github.com/chocolatey/choco/issues/new/choose.
135+
136+
");
137+
123138
"chocolatey".Log().Info(ChocolateyLoggers.Important, "See It In Action");
124139
"chocolatey".Log().Info(@"
125140
Config shown in action: https://raw.githubusercontent.com/wiki/chocolatey/choco/images/gifs/choco_config.gif

src/chocolatey/infrastructure.app/commands/ChocolateyFeatureCommand.cs

+14
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,20 @@ choco feature list
101101
NOTE: See scripting in the command reference (`choco -?`) for how to
102102
write proper scripts and integrations.
103103
104+
");
105+
106+
"chocolatey".Log().Info(ChocolateyLoggers.Important, "Exit Codes");
107+
"chocolatey".Log().Info(@"
108+
Exit codes that normally result from running this command.
109+
110+
Normal:
111+
- 0: operation was successful, no issues detected
112+
- -1 or 1: an error has occurred
113+
114+
If you find other exit codes that we have not yet documented, please
115+
file a ticket so we can document it at
116+
https://github.com/chocolatey/choco/issues/new/choose.
117+
104118
");
105119

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

src/chocolatey/infrastructure.app/commands/ChocolateyInfoCommand.cs

+22
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,28 @@ choco info powershell
100100
write proper scripts and integrations.
101101
102102
");
103+
"chocolatey".Log().Info(ChocolateyLoggers.Important, "Exit Codes");
104+
"chocolatey".Log().Info(@"
105+
Exit codes that normally result from running this command.
106+
107+
Normal:
108+
- 0: operation was successful, no issues detected
109+
- -1 or 1: an error has occurred
110+
111+
Enhanced:
112+
- 0: operation was successful, no issues detected
113+
- -1 or 1: an error has occurred
114+
- 2: no results (enhanced)
115+
116+
NOTE: Starting in v0.10.12, if you have the feature '{0}'
117+
turned on, then choco will provide enhanced exit codes that allow
118+
better integration and scripting.
119+
120+
If you find other exit codes that we have not yet documented, please
121+
file a ticket so we can document it at
122+
https://github.com/chocolatey/choco/issues/new/choose.
123+
124+
".format_with(ApplicationParameters.Features.UseEnhancedExitCodes));
103125
"chocolatey".Log().Info(ChocolateyLoggers.Important, "Options and Switches");
104126
}
105127
}

src/chocolatey/infrastructure.app/commands/ChocolateyInstallCommand.cs

+29
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,35 @@ go modify Path to just one Ruby and then use something like uru
300300
write proper scripts and integrations.
301301
302302
");
303+
304+
"chocolatey".Log().Info(ChocolateyLoggers.Important, "Exit Codes");
305+
"chocolatey".Log().Info(@"
306+
Exit codes that normally result from running this command.
307+
308+
Normal:
309+
- 0: operation was successful, no issues detected
310+
- -1 or 1: an error has occurred
311+
312+
Package Exit Codes:
313+
- 1641: success, reboot initiated
314+
- 3010: success, reboot required
315+
- other (not listed): likely an error has occurred
316+
317+
In addition to normal exit codes, packages are allowed to exit
318+
with their own codes when the feature '{0}' is
319+
turned on. Uninstall command has additional valid exit codes.
320+
Available in v0.9.10+.
321+
322+
Reboot Exit Codes:
323+
- 350: pending reboot detected, no action has occurred
324+
- 1604: install suspended, incomplete
325+
326+
In addition to the above exit codes, you may also see reboot exit codes
327+
when the feature '{1}' is turned on. It typically requires
328+
the feature '{0}' to also be turned on to work properly.
329+
Available in v0.10.12+.
330+
".format_with(ApplicationParameters.Features.UsePackageExitCodes, ApplicationParameters.Features.ExitOnRebootDetected));
331+
303332
"chocolatey".Log().Info(ChocolateyLoggers.Important, "See It In Action");
304333
"chocolatey".Log().Info(@"
305334
Chocolatey FOSS install showing tab completion and `refreshenv` (a way

src/chocolatey/infrastructure.app/commands/ChocolateyListCommand.cs

+24
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,30 @@ choco search git
171171
write proper scripts and integrations.
172172
173173
");
174+
175+
"chocolatey".Log().Info(ChocolateyLoggers.Important, "Exit Codes");
176+
"chocolatey".Log().Info(@"
177+
Exit codes that normally result from running this command.
178+
179+
Normal:
180+
- 0: operation was successful, no issues detected
181+
- -1 or 1: an error has occurred
182+
183+
Enhanced:
184+
- 0: operation was successful, no issues detected
185+
- -1 or 1: an error has occurred
186+
- 2: no results (enhanced)
187+
188+
NOTE: Starting in v0.10.12, if you have the feature '{0}'
189+
turned on, then choco will provide enhanced exit codes that allow
190+
better integration and scripting.
191+
192+
If you find other exit codes that we have not yet documented, please
193+
file a ticket so we can document it at
194+
https://github.com/chocolatey/choco/issues/new/choose.
195+
196+
".format_with(ApplicationParameters.Features.UseEnhancedExitCodes));
197+
174198
"chocolatey".Log().Info(ChocolateyLoggers.Important, "See It In Action");
175199
"chocolatey".Log().Info(@"
176200
choco search: https://raw.githubusercontent.com/wiki/chocolatey/choco/images/gifs/choco_search.gif

src/chocolatey/infrastructure.app/commands/ChocolateyNewCommand.cs

+14
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,20 @@ This is called automatic recompile.
160160
NOTE: See scripting in the command reference (`choco -?`) for how to
161161
write proper scripts and integrations.
162162
163+
");
164+
165+
"chocolatey".Log().Info(ChocolateyLoggers.Important, "Exit Codes");
166+
"chocolatey".Log().Info(@"
167+
Exit codes that normally result from running this command.
168+
169+
Normal:
170+
- 0: operation was successful, no issues detected
171+
- -1 or 1: an error has occurred
172+
173+
If you find other exit codes that we have not yet documented, please
174+
file a ticket so we can document it at
175+
https://github.com/chocolatey/choco/issues/new/choose.
176+
163177
");
164178

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

src/chocolatey/infrastructure.app/commands/ChocolateyOutdatedCommand.cs

+24
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,30 @@ you may want to add `--ignore-unfound` to your options.
106106
write proper scripts and integrations.
107107
108108
");
109+
110+
"chocolatey".Log().Info(ChocolateyLoggers.Important, "Exit Codes");
111+
"chocolatey".Log().Info(@"
112+
Exit codes that normally result from running this command.
113+
114+
Normal:
115+
- 0: operation was successful, no issues detected
116+
- -1 or 1: an error has occurred
117+
118+
Enhanced:
119+
- 0: no outdated packages
120+
- -1 or 1: an error has occurred
121+
- 2: outdated packages have been found
122+
123+
NOTE: Starting in v0.10.12, if you have the feature '{0}'
124+
turned on, then choco will provide enhanced exit codes that allow
125+
better integration and scripting.
126+
127+
If you find other exit codes that we have not yet documented, please
128+
file a ticket so we can document it at
129+
https://github.com/chocolatey/choco/issues/new/choose.
130+
131+
".format_with(ApplicationParameters.Features.UseEnhancedExitCodes));
132+
109133
"chocolatey".Log().Info(ChocolateyLoggers.Important, "See It In Action");
110134
"chocolatey".Log().Info(@"
111135
choco outdated: https://raw.githubusercontent.com/wiki/chocolatey/choco/images/gifs/choco_outdated.gif

src/chocolatey/infrastructure.app/commands/ChocolateyPackCommand.cs

+14
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,20 @@ choco pack --outputdirectory build
113113
NOTE: See scripting in the command reference (`choco -?`) for how to
114114
write proper scripts and integrations.
115115
116+
");
117+
118+
"chocolatey".Log().Info(ChocolateyLoggers.Important, "Exit Codes");
119+
"chocolatey".Log().Info(@"
120+
Exit codes that normally result from running this command.
121+
122+
Normal:
123+
- 0: operation was successful, no issues detected
124+
- -1 or 1: an error has occurred
125+
126+
If you find other exit codes that we have not yet documented, please
127+
file a ticket so we can document it at
128+
https://github.com/chocolatey/choco/issues/new/choose.
129+
116130
");
117131

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

src/chocolatey/infrastructure.app/commands/ChocolateyPinCommand.cs

+14
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,20 @@ choco pin remove --name git
118118
NOTE: See scripting in the command reference (`choco -?`) for how to
119119
write proper scripts and integrations.
120120
121+
");
122+
123+
"chocolatey".Log().Info(ChocolateyLoggers.Important, "Exit Codes");
124+
"chocolatey".Log().Info(@"
125+
Exit codes that normally result from running this command.
126+
127+
Normal:
128+
- 0: operation was successful, no issues detected
129+
- -1 or 1: an error has occurred
130+
131+
If you find other exit codes that we have not yet documented, please
132+
file a ticket so we can document it at
133+
https://github.com/chocolatey/choco/issues/new/choose.
134+
121135
");
122136

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

src/chocolatey/infrastructure.app/commands/ChocolateyPushCommand.cs

+14
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,20 @@ You can verify by going to {0}packages/packageName.
199199
and you don't see a good reason for it.
200200
".format_with(ApplicationParameters.ChocolateyCommunityFeedPushSource));
201201

202+
"chocolatey".Log().Info(ChocolateyLoggers.Important, "Exit Codes");
203+
"chocolatey".Log().Info(@"
204+
Exit codes that normally result from running this command.
205+
206+
Normal:
207+
- 0: operation was successful, no issues detected
208+
- -1 or 1: an error has occurred
209+
210+
If you find other exit codes that we have not yet documented, please
211+
file a ticket so we can document it at
212+
https://github.com/chocolatey/choco/issues/new/choose.
213+
214+
");
215+
202216
"chocolatey".Log().Info(ChocolateyLoggers.Important, "Options and Switches");
203217
}
204218

src/chocolatey/infrastructure.app/commands/ChocolateySourceCommand.cs

+14
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,20 @@ choco source list
156156
NOTE: See scripting in the command reference (`choco -?`) for how to
157157
write proper scripts and integrations.
158158
159+
");
160+
161+
"chocolatey".Log().Info(ChocolateyLoggers.Important, "Exit Codes");
162+
"chocolatey".Log().Info(@"
163+
Exit codes that normally result from running this command.
164+
165+
Normal:
166+
- 0: operation was successful, no issues detected
167+
- -1 or 1: an error has occurred
168+
169+
If you find other exit codes that we have not yet documented, please
170+
file a ticket so we can document it at
171+
https://github.com/chocolatey/choco/issues/new/choose.
172+
159173
");
160174

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

src/chocolatey/infrastructure.app/commands/ChocolateyUninstallCommand.cs

+29
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,35 @@ write proper scripts and integrations.
232232
233233
");
234234

235+
"chocolatey".Log().Info(ChocolateyLoggers.Important, "Exit Codes");
236+
"chocolatey".Log().Info(@"
237+
Exit codes that normally result from running this command.
238+
239+
Normal:
240+
- 0: operation was successful, no issues detected
241+
- -1 or 1: an error has occurred
242+
243+
Package Exit Codes:
244+
- 1605: software is not installed
245+
- 1614: product is uninstalled
246+
- 1641: success, reboot initiated
247+
- 3010: success, reboot required
248+
- other (not listed): likely an error has occurred
249+
250+
In addition to normal exit codes, packages are allowed to exit
251+
with their own codes when the feature '{0}' is
252+
turned on. Available in v0.9.10+.
253+
254+
Reboot Exit Codes:
255+
- 350: pending reboot detected, no action has occurred
256+
- 1604: install suspended, incomplete
257+
258+
In addition to the above exit codes, you may also see reboot exit codes
259+
when the feature '{1}' is turned on. It typically requires
260+
the feature '{0}' to also be turned on to work properly.
261+
Available in v0.10.12+.
262+
".format_with(ApplicationParameters.Features.UsePackageExitCodes, ApplicationParameters.Features.ExitOnRebootDetected));
263+
235264
"chocolatey".Log().Info(ChocolateyLoggers.Important, "Options and Switches");
236265
"chocolatey".Log().Info(@"
237266
NOTE: Options and switches apply to all items passed, so if you are

src/chocolatey/infrastructure.app/commands/ChocolateyUpgradeCommand.cs

+29
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,35 @@ choco upgrade all
305305
write proper scripts and integrations.
306306
307307
");
308+
309+
"chocolatey".Log().Info(ChocolateyLoggers.Important, "Exit Codes");
310+
"chocolatey".Log().Info(@"
311+
Exit codes that normally result from running this command.
312+
313+
Normal:
314+
- 0: operation was successful, no issues detected
315+
- -1 or 1: an error has occurred
316+
317+
Package Exit Codes:
318+
- 1641: success, reboot initiated
319+
- 3010: success, reboot required
320+
- other (not listed): likely an error has occurred
321+
322+
In addition to normal exit codes, packages are allowed to exit
323+
with their own codes when the feature '{0}' is
324+
turned on. Uninstall command has additional valid exit codes.
325+
Available in v0.9.10+.
326+
327+
Reboot Exit Codes:
328+
- 350: pending reboot detected, no action has occurred
329+
- 1604: install suspended, incomplete
330+
331+
In addition to the above exit codes, you may also see reboot exit codes
332+
when the feature '{1}' is turned on. It typically requires
333+
the feature '{0}' to also be turned on to work properly.
334+
Available in v0.10.12+.
335+
".format_with(ApplicationParameters.Features.UsePackageExitCodes, ApplicationParameters.Features.ExitOnRebootDetected));
336+
308337
"chocolatey".Log().Info(ChocolateyLoggers.Important, "See It In Action");
309338
"chocolatey".Log().Info(@"
310339
choco upgrade: https://raw.githubusercontent.com/wiki/chocolatey/choco/images/gifs/choco_upgrade.gif

0 commit comments

Comments
 (0)