From 2d1e6b3b36cfbdef4173f1e859a8572547b7e5ff Mon Sep 17 00:00:00 2001 From: Rashil Gandhi Date: Tue, 21 Jun 2022 13:31:57 +0530 Subject: [PATCH 1/5] feat(scoop-reset): Add -a/--all switch to reset all apps --- libexec/scoop-reset.ps1 | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/libexec/scoop-reset.ps1 b/libexec/scoop-reset.ps1 index 05cefe47cc..f84328bcbe 100644 --- a/libexec/scoop-reset.ps1 +++ b/libexec/scoop-reset.ps1 @@ -3,6 +3,8 @@ # Help: Used to resolve conflicts in favor of a particular app. For example, # if you've installed 'python' and 'python27', you can use 'scoop reset' to switch between # using one or the other. +# +# You can use '*' in place of or `-a`/`--all` switch to reset all apps. . "$PSScriptRoot\..\lib\getopt.ps1" . "$PSScriptRoot\..\lib\manifest.ps1" # 'Select-CurrentVersion' (indirectly) @@ -10,12 +12,13 @@ . "$PSScriptRoot\..\lib\versions.ps1" # 'Select-CurrentVersion' . "$PSScriptRoot\..\lib\shortcuts.ps1" -$opt, $apps, $err = getopt $args +$opt, $apps, $err = getopt $args 'a' 'all' if($err) { "scoop reset: $err"; exit 1 } +$all = $opt.a -or $opt.all -if(!$apps) { error ' missing'; my_usage; exit 1 } +if(!$apps -and !$all) { error ' missing'; my_usage; exit 1 } -if($apps -eq '*') { +if($apps -eq '*' -or $all) { $local = installed_apps $false | ForEach-Object { ,@($_, $false) } $global = installed_apps $true | ForEach-Object { ,@($_, $true) } $apps = @($local) + @($global) From 5d62293cd4913fa34cff031b3c61eb4a6d81f1d7 Mon Sep 17 00:00:00 2001 From: Rashil Gandhi Date: Tue, 21 Jun 2022 13:45:38 +0530 Subject: [PATCH 2/5] feat(scoop-cache): Add -a/--all switch to delete whole cache --- libexec/scoop-cache.ps1 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libexec/scoop-cache.ps1 b/libexec/scoop-cache.ps1 index 96cd23763c..959c73fcde 100644 --- a/libexec/scoop-cache.ps1 +++ b/libexec/scoop-cache.ps1 @@ -10,6 +10,8 @@ # # To clear everything in your cache, use: # scoop cache rm * +# You can also use the `-a/--all` switch in place of `*` here + param($cmd) function cacheinfo($file) { @@ -36,7 +38,7 @@ function cacheremove($app) { 'ERROR: missing' my_usage exit 1 - } elseif ($app -eq '*') { + } elseif ($app -eq '*' -or $app -eq '-a' -or $app -eq '--all') { $files = @(Get-ChildItem $cachedir) } else { $app = '(' + ($app -join '|') + ')' From 2d812d275f966210db7e0fa6f5c32a43c8fe69d6 Mon Sep 17 00:00:00 2001 From: Rashil Gandhi Date: Tue, 21 Jun 2022 14:11:16 +0530 Subject: [PATCH 3/5] feat(scoop-virustotal): Add -e/--every switch to check every installed app --- libexec/scoop-virustotal.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libexec/scoop-virustotal.ps1 b/libexec/scoop-virustotal.ps1 index 37da80ce52..221f91337d 100644 --- a/libexec/scoop-virustotal.ps1 +++ b/libexec/scoop-virustotal.ps1 @@ -2,7 +2,7 @@ # Summary: Look for app's hash or url on virustotal.com # Help: Look for app's hash or url on virustotal.com # -# Use a single '*' for app to check all installed apps. +# Use a single '*' or the '-e/--every' switch to check every installed app. # # To use this command, you have to sign up to VirusTotal's community, # and get an API key. Then, tell scoop about your API key with: @@ -34,7 +34,7 @@ . "$PSScriptRoot\..\lib\install.ps1" # 'hash_for_url' . "$PSScriptRoot\..\lib\depends.ps1" # 'Get-Dependency' -$opt, $apps, $err = getopt $args 'a:snup' @('arch=', 'scan', 'no-depends', 'no-update-scoop', 'passthru') +$opt, $apps, $err = getopt $args 'a:snupe' @('arch=', 'scan', 'no-depends', 'no-update-scoop', 'passthru', 'every') if ($err) { "scoop virustotal: $err"; exit 1 } if (!$apps) { my_usage; exit 1 } $architecture = ensure_architecture ($opt.a + $opt.arch) @@ -49,7 +49,7 @@ if (is_scoop_outdated) { $apps_param = $apps -if ($apps_param -eq '*') { +if ($apps_param -eq '*' -or $opt.e -or $opt.every) { $apps = installed_apps $false $apps += installed_apps $true } From b6e522f91433058d88608b4225102e981b55a2ef Mon Sep 17 00:00:00 2001 From: Rashil Gandhi <46838874+rashil2000@users.noreply.github.com> Date: Tue, 21 Jun 2022 14:22:55 +0530 Subject: [PATCH 4/5] Update CHANGELOG.md --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5f90d6ebc2..731342966b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ ## [Unreleased](https://github.com/ScoopInstaller/Scoop/compare/master...develop) +### Features + +- **chore:** Add missing -a/--all param to all commands ([#5004](https://github.com/ScoopInstaller/Scoop/issues/5004)) + ### Bug Fixes - **chore:** Update help documentation ([#5002](https://github.com/ScoopInstaller/Scoop/issues/5002)) From ffb1373e76c1a4347a103e14325067cbb6a01b23 Mon Sep 17 00:00:00 2001 From: Rashil Gandhi Date: Wed, 22 Jun 2022 14:16:35 +0530 Subject: [PATCH 5/5] use 'all' instead of 'every' --- libexec/scoop-virustotal.ps1 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libexec/scoop-virustotal.ps1 b/libexec/scoop-virustotal.ps1 index 221f91337d..ef4b84e2f6 100644 --- a/libexec/scoop-virustotal.ps1 +++ b/libexec/scoop-virustotal.ps1 @@ -2,7 +2,7 @@ # Summary: Look for app's hash or url on virustotal.com # Help: Look for app's hash or url on virustotal.com # -# Use a single '*' or the '-e/--every' switch to check every installed app. +# Use a single '*' or the '-a/--all' switch to check all installed apps. # # To use this command, you have to sign up to VirusTotal's community, # and get an API key. Then, tell scoop about your API key with: @@ -20,7 +20,7 @@ # 2 & 4 combined # # Options: -# -a, --arch <32bit|64bit> Use the specified architecture, if the app supports it +# -a, --all Check for all installed apps # -s, --scan For packages where VirusTotal has no information, send download URL # for analysis (and future retrieval). This requires you to configure # your virustotal_api_key. @@ -34,10 +34,10 @@ . "$PSScriptRoot\..\lib\install.ps1" # 'hash_for_url' . "$PSScriptRoot\..\lib\depends.ps1" # 'Get-Dependency' -$opt, $apps, $err = getopt $args 'a:snupe' @('arch=', 'scan', 'no-depends', 'no-update-scoop', 'passthru', 'every') +$opt, $apps, $err = getopt $args 'asnup' @('all', 'scan', 'no-depends', 'no-update-scoop', 'passthru') if ($err) { "scoop virustotal: $err"; exit 1 } if (!$apps) { my_usage; exit 1 } -$architecture = ensure_architecture ($opt.a + $opt.arch) +$architecture = ensure_architecture if (is_scoop_outdated) { if ($opt.u -or $opt.'no-update-scoop') { @@ -49,7 +49,7 @@ if (is_scoop_outdated) { $apps_param = $apps -if ($apps_param -eq '*' -or $opt.e -or $opt.every) { +if ($apps_param -eq '*' -or $opt.a -or $opt.all) { $apps = installed_apps $false $apps += installed_apps $true }