@@ -35,35 +35,35 @@ function script:chocoCmdOperations($commands, $command, $filter, $currentArgumen
35
35
Where-Object { $_ -like " $filter *" }
36
36
}
37
37
38
- $script :chocoCommands = @ (' -? ' , ' apikey' , ' cache' , ' config' , ' export' , ' feature' , ' help' , ' info' , ' install' , ' list' , ' new' , ' outdated' , ' pack' , ' pin' , ' push' , ' rule' , ' search' , ' source' , ' template ' , ' uninstall ' , ' upgrade ' , ' -h ' , ' --help' , ' --version' )
38
+ $script :chocoCommands = @ (' apikey' , ' cache' , ' config' , ' export' , ' feature' , ' help' , ' info' , ' install' , ' license ' , ' list' , ' new' , ' outdated' , ' pack' , ' pin' , ' push' , ' rule' , ' search' , ' source' , ' support ' , ' template ' , ' uninstall ' , ' upgrade ' , ' --help' , ' --version' )
39
39
40
40
# ensure these all have a space to start, or they will cause issues
41
- $allCommands = " --accept-license --cache-location='' --confirm --debug --execution-timeout='' --force --help -? -- ignore-http-cache --limit-output --log-file='' --no-color --no-progress --noop --online --proxy='' --proxy-bypass-list='' --proxy-bypass-on-local --proxy-password='' --proxy-user='' --skip-compatibility-checks --trace --verbose"
41
+ $allCommands = " --accept-license --cache-location='' --debug --fail-on-standard-error --force --help -- ignore-http-cache --limit-output --log-file='' --no-color --no-progress --noop --online --proxy='' --proxy-bypass-list='' --proxy-bypass-on-local --proxy-password='' --proxy-user='' --skip-compatibility-checks --timeout='' -- trace --use-system-powershell -- verbose --yes "
42
42
43
43
$commandOptions = @ {
44
- apikey = " --api-key='' --remove -- source=''"
44
+ apikey = " --api-key='' --source=''"
45
45
cache = " --expired"
46
46
config = " --name='' --value=''"
47
- export = " --include-version-numbers --output-file-path=''"
47
+ export = " --include-version --output-file-path=''"
48
48
feature = " --name=''"
49
- info = " --cert='' --certpassword='' --disable-package-repository-optimizations --include-configured-sources --local-only --password='' --prerelease --source='' --user='' --version=''"
50
- install = " --allow-downgrade --allow-empty-checksums --allow-empty-checksums-secure --disable-package-repository-optimizations --download-checksum='' --download-checksum-x64='' --download-checksum-type='' --download-checksum-type-x64='' --exit-when-reboot-detected --force-dependencies --forcex86 --ignore-checksums --ignore-dependencies --ignore-detected-reboot --ignore-package-exit-codes --include-configured-sources --install-arguments='' --not-silent --override-arguments --package-parameters='' --params='' --password='' --pin --pre --prerelease --require-checksums --skip-automation-scripts --source='' --source='windowsfeatures' --stop-on-first-package-failure --use-package-exit-codes --user='' --version='' -whatif -y"
51
- list = " --by-id-only --detailed --exact --id-only --id-starts-with --include-programs --page='' --page-size='' --pre --prerelease --source=''"
52
- new = " --automaticpackage installertype='' --maintainer='' maintainername='' maintainerrepo='' --output-directory='' packageversion='' silentargs='' --template-name='' url='' url64='' --use-built-in-template --version=''"
53
- outdated = " --disable-package-repository-optimizations --ignore-pinned --ignore-unfound --include-configured-sources --password='' --pre --prerelease --source='' --user=''"
49
+ info = " --cert='' --certpassword='' --disable-repository-optimizations --include-configured-sources --local-only --password='' --prerelease --source='' --user='' --version=''"
50
+ install = " --allow-downgrade --allow-empty-checksums --allow-empty-checksums-secure --apply-args-to-dependencies --apply-package-parameters-to-dependencies --cert='' --certpassword='' --disable-repository-optimizations --download-checksum='' --download-checksum-x64='' --download-checksum-type='' --download-checksum-type-x64='' --exit-when-reboot-detected --force-dependencies --forcex86 --ignore-checksum --ignore-dependencies --ignore-detected-reboot --ignore-package-exit-codes --include-configured-sources --install-arguments='' --not-silent --override-arguments --package-parameters='' --password='' --pin --prerelease --require-checksums --skip-hooks --skip-scripts --source='' --stop-on-first-failure --use-package-exit-codes --user='' --version=''"
51
+ license = " "
52
+ list = " --by-id-only --by-tag-only --detail --exact --id-only --id-starts-with --include-programs --page='' --page-size='' --prerelease --source='' --version=''"
53
+ new = " --automaticpackage --download-checksum='' --download-checksum-x64='' --download-checksum-type='' --maintainer='' --name='' --output-directory='' --template='' --use-built-in-template --version=''"
54
+ outdated = " --cert='' --certpassword='' --disable-repository-optimizations --ignore-pinned --ignore-unfound --include-configured-sources --password='' --prerelease --source='' --user=''"
54
55
pack = " --output-directory='' --version=''"
55
56
pin = " --name='' --version=''"
56
- push = " --api-key='' --source='' --timeout='' "
57
+ push = " --api-key='' --source=''"
57
58
rule = " --name=''"
58
- search = " --approved-only --by-id-only --detailed --disable-package-repository-optimizations --download-cache-only --exact --id-only --id-starts-with --include-configured-sources --include-programs --not-broken --order-by-popularity --page='' --page-size='' --password='' --pre --prerelease --source='' --user=''"
59
- source = " --allow-self-service --bypass-proxy --name='' --password='' --priority='' --source='' --user=''"
59
+ search = " --all-versions --approved-only --by-id-only --by-tag-only --cert='' --certpassword='' --detail --disable-repository-optimizations --download-cache-only --exact --id-only --id-starts-with --include-configured-sources --include-programs --not-broken --order-by-popularity --page='' --page-size='' --password='' --prerelease --source='' --user=''"
60
+ source = " --admin-only --allow-self-service --bypass-proxy --cert='' --certpassword='' --name='' --password='' --priority='' --source='' --user=''"
61
+ support = " "
60
62
template = " --name=''"
61
- uninstall = " --all-versions --exit-when-reboot-detected --fail-on-autouninstaller --force-dependencies --ignore-autouninstaller-failure --ignore-detected-reboot --ignore-package-exit-codes --not-silent --override-arguments --params='' -- package-parameters='' --remove-dependencies --skip-automation-scripts --skip-autouninstaller --source='windowsfeatures ' --stop-on-first-package- failure --uninstall-arguments='' --use-autouninstaller --use-package-exit-codes --version='' -whatif -y "
62
- upgrade = " --allow-downgrade --allow-empty-checksums --allow-empty-checksums-secure --disable- package-repository-optimizations --download-checksum='' --download-checksum-x64='' --download-checksum-type='' --download-checksum-type-x64='' --except='' --exclude-prerelease --exit-when-reboot-detected --fail-on-not-installed --fail-on-unfound --forcex86 --ignore-checksums --ignore-dependencies --ignore-detected-reboot --ignore-package-exit-codes --ignore-pinned --ignore-remembered-options --include-configured-sources --install-arguments='' --install-if-not-installed --not-silent --override-arguments --package-parameters='' --params='' -- password='' --pin --pre -- prerelease --require-checksums --skip-automation-scripts --skip-when -not-installed --source='' --source='windowsfeatures ' --stop-on-first-package- failure --use-package-exit-codes --use-remembered-options --user='' --version='' -whatif -y "
63
+ uninstall = " --all-versions --apply-args-to-dependencies --apply-package-parameters-to-dependencies -- exit-when-reboot-detected --fail-on-autouninstaller --force-dependencies --ignore-autouninstaller-failure --ignore-detected-reboot --ignore-package-exit-codes --not-silent --override-arguments --package-parameters='' --skip-autouninstaller --skip-hooks --skip-scripts --source='' --stop-on-first-failure --uninstall-arguments='' --use-autouninstaller --use-package-exit-codes --version=''"
64
+ upgrade = " --allow-downgrade --allow-empty-checksums --allow-empty-checksums-secure --apply-args-to-dependencies --apply- package-parameters-to-dependencies --cert='' --certpassword='' --disable- repository-optimizations --download-checksum='' --download-checksum-x64='' --download-checksum-type='' --download-checksum-type-x64='' --except='' --exclude-prerelease --exit-when-reboot-detected --fail-on-not-installed --fail-on-unfound --forcex86 --ignore-checksums --ignore-dependencies --ignore-detected-reboot --ignore-package-exit-codes --ignore-pinned --ignore-remembered-arguments --ignore-unfound -- include-configured-sources --install-arguments='' --install-if-not-installed --not-silent --override-arguments --package-parameters='' --password='' --pin --prerelease --require-checksums --skip-hooks --skip-if -not-installed --skip-scripts --source='' --stop-on-first-failure --use-package-exit-codes --use-remembered-arguments --user='' --version=''"
63
65
}
64
66
65
- $commandOptions [' find' ] = $commandOptions [' search' ]
66
-
67
67
$licenseFile = " $env: ChocolateyInstall \license\chocolatey.license.xml"
68
68
69
69
if (Test-Path $licenseFile ) {
@@ -74,17 +74,16 @@ if (Test-Path $licenseFile) {
74
74
' optimize'
75
75
)
76
76
77
- $commandOptions.download = " --append-use-original-location --cert='' --certpassword='' --disable-package-repository-optimizations --download-location='' --ignore-dependencies --ignore-unfound-packages --installed-packages --internalize --internalize-all-urls --outputdirectory='' --password='' --prerelease --recompile --resources-location='' --source='' --user='' --version=''"
78
- $commandOptions.sync = " --id='' --output-directory='' --package-id=''"
79
- $commandOptions.optimize = " --id='' --deflate-nupkg-only"
77
+ $commandOptions.download = " --append-use-original-location --cert='' --certpassword='' --disable-repository-optimizations --download-location='' --ignore-dependencies --ignore-unfound --installed-packages --internalize --internalize-all-urls --output-directory='' --password='' --prerelease --resources-location='' --skip-download-cache --skip-virus-check --source='' --use-download-cache --user='' --version='' --virus-check --virus-positives-minimum=''"
78
+ $commandOptions.optimize = " --id='' --reduce-nupkg-only"
80
79
81
80
# Add pro switches to commands that have additional switches on Pro
82
- $proInstallUpgradeOptions = " --deflate-nupkg-only--deflate-package-size -- install-arguments-sensitive='' --install-directory='' --max-download-rate ='' --package-parameters-sensitive='' --no-deflate- package-size --skip-download-cache --skip-virus-check --use-download-cache --virus-check --virus-positives-minimum=''"
81
+ $proInstallUpgradeOptions = " --install-arguments-sensitive='' --install-directory='' --max-download-bits-per-second ='' --no-reduce- package-size --package- parameters-sensitive='' --reason='' --reduce- package-size --reduce-nupkg-only --skip-download-cache --skip-virus-check --use-download-cache --virus-check --virus-positives-minimum=''"
83
82
84
83
$commandOptions.install += $proInstallUpgradeOptions
84
+ $commandOptions.new += " --build-package --pause-on-error --use-original-location"
85
+ $commandOptions.pin += " --reason=''"
85
86
$commandOptions.upgrade += $proInstallUpgradeOptions + " --exclude-chocolatey-packages-during-upgrade-all --include-chocolatey-packages-during-upgrade-all"
86
- $commandOptions.new += " --build-package --checksum='' --checksum64='' --checksumtype='' --keep-remote --pause-on-error --url='' --url64='' --use-original-location"
87
- $commandOptions.pin += " --note=''"
88
87
89
88
# Add Business-only commands and options if the license is a Business or Trial license
90
89
[xml ]$xml = Get-Content - Path $licenseFile - ErrorAction Stop
@@ -95,24 +94,27 @@ if (Test-Path $licenseFile) {
95
94
# Add business-only commands
96
95
$script :chocoCommands = @ (
97
96
$script :chocoCommands
98
- ' support '
97
+ ' convert '
99
98
' sync'
100
99
)
101
100
102
- $commandOptions.list += " --audit"
101
+ $commandOptions.convert = " --ignore-dependencies --include-all --to-format=''"
102
+ $commandOptions.list += " --show-audit"
103
+ $commandOptions.new += " --file='' --file64='' --from-programs-and-features --include-architecture-in-name --remove-architecture-from-name --url='' --url64=''"
104
+ $commandOptions.push += " --client-code='' --endpoint='' redirect-url='' --skip-cleanup"
105
+ $commandOptions.sync = " --id='' --output-directory='' --package-id=''"
103
106
$commandOptions.uninstall += " --from-programs-and-features"
104
- $commandOptions.new += " --file='' --file64='' --from-programs-and-features --include-architecture-in-name --remove-architecture-from-name"
105
107
106
108
# Add --use-self-service to commands that support it
107
- $selfServiceCommands = ' download' , ' find ' , ' info' , ' install' , ' list' , ' optimize' , ' outdated' , ' pin' , ' push' , ' search' , ' sync' , ' uninstall' , ' upgrade'
109
+ $selfServiceCommands = ' download' , ' info' , ' install' , ' list' , ' optimize' , ' outdated' , ' pin' , ' push' , ' search' , ' sync' , ' uninstall' , ' upgrade'
108
110
foreach ($command in $selfServiceCommands ) {
109
111
$commandOptions .$command += ' --use-self-service'
110
112
}
111
113
}
112
114
}
113
115
114
116
foreach ($key in @ ($commandOptions.Keys )) {
115
- $commandOptions .$key += $ allCommands
117
+ $commandOptions .$key = ( $commandOptions . $key + $ allCommands).Trim()
116
118
}
117
119
118
120
# Consistent ordering for commands so the added pro commands aren't weirdly out of order
@@ -167,64 +169,79 @@ function Get-AliasPattern($exe) {
167
169
function ChocolateyTabExpansion ($lastBlock ) {
168
170
switch - regex ($lastBlock -replace " ^$ ( Get-AliasPattern choco) " , " " ) {
169
171
172
+ # Handles apikey first tab
173
+ " ^(apikey)\s+(?<subcommand>[^-\s]*)$" {
174
+ @ (' add' , ' list' , ' remove' , ' --help' ) | Where-Object { $_ -like " $ ( $matches [' subcommand' ]) *" }
175
+ }
176
+
170
177
# Handles cache first tab
171
178
" ^(cache)\s+(?<subcommand>[^-\s]*)$" {
172
- @ (' list' , ' remove' , ' -? ' ) | Where-Object { $_ -like " $ ( $matches [' subcommand' ]) *" }
179
+ @ (' list' , ' remove' , ' --help ' ) | Where-Object { $_ -like " $ ( $matches [' subcommand' ]) *" }
173
180
}
174
181
175
182
# Handles config first tab
176
183
" ^(config)\s+(?<subcommand>[^-\s]*)$" {
177
- @ (' list ' , ' get ' , ' set' , ' unset' , ' -? ' ) | Where-Object { $_ -like " $ ( $matches [' subcommand' ]) *" }
184
+ @ (' get ' , ' list ' , ' set' , ' unset' , ' --help ' ) | Where-Object { $_ -like " $ ( $matches [' subcommand' ]) *" }
178
185
}
179
186
180
187
# Handles feature first tab
181
188
" ^(feature)\s+(?<subcommand>[^-\s]*)$" {
182
- @ (' list ' , ' get ' , ' disable ' , ' enable ' , ' -? ' ) | Where-Object { $_ -like " $ ( $matches [' subcommand' ]) *" }
189
+ @ (' disable ' , ' enable ' , ' get ' , ' list ' , ' --help ' ) | Where-Object { $_ -like " $ ( $matches [' subcommand' ]) *" }
183
190
}
184
191
185
192
# Handles install package names
186
193
" ^(install)\s+(?<package>[^\.][^-\s]+)$" {
187
194
chocoRemotePackages $matches [' package' ]
188
195
}
189
196
197
+ # Handles license first tab
198
+ " ^(license)\s+(?<subcommand>[^-\s]*)$" {
199
+ @ (' info' , ' --help' ) | Where-Object { $_ -like " $ ( $matches [' subcommand' ]) *" }
200
+ }
201
+
190
202
# Handles list first tab
191
203
" ^(list)\s+(?<subcommand>[^-\s]*)$" {
192
- @ (' <filter>' , ' -? ' ) | Where-Object { $_ -like " $ ( $matches [' subcommand' ]) *" }
204
+ @ (' <filter>' , ' --help ' ) | Where-Object { $_ -like " $ ( $matches [' subcommand' ]) *" }
193
205
}
194
206
195
207
# Handles new first tab
196
208
" ^(new)\s+(?<subcommand>[^-\s]*)$" {
197
- @ (' <name>' , ' -? ' ) | Where-Object { $_ -like " $ ( $matches [' subcommand' ]) *" }
209
+ @ (' <name>' , ' --help ' ) | Where-Object { $_ -like " $ ( $matches [' subcommand' ]) *" }
198
210
}
199
211
200
212
# Handles pack first tab
201
213
" ^(pack)\s+(?<subcommand>[^-\s]*)$" {
202
- @ (' <PathtoNuspec>' , ' -? ' ) | Where-Object { $_ -like " $ ( $matches [' subcommand' ]) *" }
214
+ @ (' <PathtoNuspec>' , ' --help ' ) | Where-Object { $_ -like " $ ( $matches [' subcommand' ]) *" }
203
215
}
204
216
205
217
# Handles pin first tab
206
218
" ^(pin)\s+(?<subcommand>[^-\s]*)$" {
207
- @ (' list ' , ' add ' , ' remove' , ' -? ' ) | Where-Object { $_ -like " $ ( $matches [' subcommand' ]) *" }
219
+ @ (' add ' , ' list ' , ' remove' , ' --help ' ) | Where-Object { $_ -like " $ ( $matches [' subcommand' ]) *" }
208
220
}
209
221
210
222
# Handles push first tab
211
223
" ^(push)\s+(?<subcommand>[^-\s]*)$" {
212
- @ (' <PathtoNupkg>' , ' -?' ) | Where-Object { $_ -like " $ ( $matches [' subcommand' ]) *" }
224
+ @ (' <PathtoNupkg>' , ' --help' ) | Where-Object { $_ -like " $ ( $matches [' subcommand' ]) *" }
225
+ }
226
+
227
+ # Handles rule first tab
228
+ " ^(rule)\s+(?<subcommand>[^-\s]*)$" {
229
+ @ (' get' , ' list' , ' --help' ) | Where-Object { $_ -like " $ ( $matches [' subcommand' ]) *" }
213
230
}
214
231
215
232
# Handles search first tab
216
- " ^(search|find )\s+(?<subcommand>[^-\s]*)$" {
217
- @ (' <filter>' , ' -? ' ) | Where-Object { $_ -like " $ ( $matches [' subcommand' ]) *" }
233
+ " ^(search)\s+(?<subcommand>[^-\s]*)$" {
234
+ @ (' <filter>' , ' --help ' ) | Where-Object { $_ -like " $ ( $matches [' subcommand' ]) *" }
218
235
}
219
236
220
237
# Handles source first tab
221
238
" ^(source)\s+(?<subcommand>[^-\s]*)$" {
222
- @ (' list ' , ' add ' , ' remove ' , ' disable ' , ' enable ' , ' -? ' ) | Where-Object { $_ -like " $ ( $matches [' subcommand' ]) *" }
239
+ @ (' add ' , ' disable ' , ' enable ' , ' list ' , ' remove ' , ' --help ' ) | Where-Object { $_ -like " $ ( $matches [' subcommand' ]) *" }
223
240
}
224
241
225
242
# Handles template first tab
226
243
" ^(template)\s+(?<subcommand>[^-\s]*)$" {
227
- @ (' list ' , ' info ' , ' -? ' ) | Where-Object { $_ -like " $ ( $matches [' subcommand' ]) *" }
244
+ @ (' info ' , ' list ' , ' --help ' ) | Where-Object { $_ -like " $ ( $matches [' subcommand' ]) *" }
228
245
}
229
246
230
247
# Handles uninstall package names
0 commit comments