Skip to content

Commit 9811a5f

Browse files
authored
feat(chore): Add missing -a/--all param to all commands (#5004)
* feat(scoop-reset): Add -a/--all switch to reset all apps * feat(scoop-cache): Add -a/--all switch to delete whole cache * feat(scoop-virustotal): Add -e/--every switch to check every installed app * Update CHANGELOG.md * use 'all' instead of 'every'
1 parent 6629331 commit 9811a5f

4 files changed

Lines changed: 15 additions & 9 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
### Features
44

5+
- **chore:** Add missing -a/--all param to all commands ([#5004](https://github.com/ScoopInstaller/Scoop/issues/5004))
56
- **scoop-status:** Check bucket status, improve output ([#5011](https://github.com/ScoopInstaller/Scoop/issues/5011))
67
- **scoop-info:** Show app installed/download size ([#4886](https://github.com/ScoopInstaller/Scoop/issues/4886))
78

libexec/scoop-cache.ps1

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
#
1111
# To clear everything in your cache, use:
1212
# scoop cache rm *
13+
# You can also use the `-a/--all` switch in place of `*` here
14+
1315
param($cmd)
1416

1517
function cacheinfo($file) {
@@ -36,7 +38,7 @@ function cacheremove($app) {
3638
'ERROR: <app(s)> missing'
3739
my_usage
3840
exit 1
39-
} elseif ($app -eq '*') {
41+
} elseif ($app -eq '*' -or $app -eq '-a' -or $app -eq '--all') {
4042
$files = @(Get-ChildItem $cachedir)
4143
} else {
4244
$app = '(' + ($app -join '|') + ')'

libexec/scoop-reset.ps1

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,22 @@
33
# Help: Used to resolve conflicts in favor of a particular app. For example,
44
# if you've installed 'python' and 'python27', you can use 'scoop reset' to switch between
55
# using one or the other.
6+
#
7+
# You can use '*' in place of <app> or `-a`/`--all` switch to reset all apps.
68

79
. "$PSScriptRoot\..\lib\getopt.ps1"
810
. "$PSScriptRoot\..\lib\manifest.ps1" # 'Select-CurrentVersion' (indirectly)
911
. "$PSScriptRoot\..\lib\install.ps1"
1012
. "$PSScriptRoot\..\lib\versions.ps1" # 'Select-CurrentVersion'
1113
. "$PSScriptRoot\..\lib\shortcuts.ps1"
1214

13-
$opt, $apps, $err = getopt $args
15+
$opt, $apps, $err = getopt $args 'a' 'all'
1416
if($err) { "scoop reset: $err"; exit 1 }
17+
$all = $opt.a -or $opt.all
1518

16-
if(!$apps) { error '<app> missing'; my_usage; exit 1 }
19+
if(!$apps -and !$all) { error '<app> missing'; my_usage; exit 1 }
1720

18-
if($apps -eq '*') {
21+
if($apps -eq '*' -or $all) {
1922
$local = installed_apps $false | ForEach-Object { ,@($_, $false) }
2023
$global = installed_apps $true | ForEach-Object { ,@($_, $true) }
2124
$apps = @($local) + @($global)

libexec/scoop-virustotal.ps1

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Summary: Look for app's hash or url on virustotal.com
33
# Help: Look for app's hash or url on virustotal.com
44
#
5-
# Use a single '*' for app to check all installed apps.
5+
# Use a single '*' or the '-a/--all' switch to check all installed apps.
66
#
77
# To use this command, you have to sign up to VirusTotal's community,
88
# and get an API key. Then, tell scoop about your API key with:
@@ -20,7 +20,7 @@
2020
# 2 & 4 combined
2121
#
2222
# Options:
23-
# -a, --arch <32bit|64bit> Use the specified architecture, if the app supports it
23+
# -a, --all Check for all installed apps
2424
# -s, --scan For packages where VirusTotal has no information, send download URL
2525
# for analysis (and future retrieval). This requires you to configure
2626
# your virustotal_api_key.
@@ -34,10 +34,10 @@
3434
. "$PSScriptRoot\..\lib\install.ps1" # 'hash_for_url'
3535
. "$PSScriptRoot\..\lib\depends.ps1" # 'Get-Dependency'
3636

37-
$opt, $apps, $err = getopt $args 'a:snup' @('arch=', 'scan', 'no-depends', 'no-update-scoop', 'passthru')
37+
$opt, $apps, $err = getopt $args 'asnup' @('all', 'scan', 'no-depends', 'no-update-scoop', 'passthru')
3838
if ($err) { "scoop virustotal: $err"; exit 1 }
3939
if (!$apps) { my_usage; exit 1 }
40-
$architecture = ensure_architecture ($opt.a + $opt.arch)
40+
$architecture = ensure_architecture
4141

4242
if (is_scoop_outdated) {
4343
if ($opt.u -or $opt.'no-update-scoop') {
@@ -49,7 +49,7 @@ if (is_scoop_outdated) {
4949

5050
$apps_param = $apps
5151

52-
if ($apps_param -eq '*') {
52+
if ($apps_param -eq '*' -or $opt.a -or $opt.all) {
5353
$apps = installed_apps $false
5454
$apps += installed_apps $true
5555
}

0 commit comments

Comments
 (0)