1
Fork 0
mirror of https://github.com/RGBCube/nu_scripts synced 2025-08-02 07:07:46 +00:00

style(scoop-completions): Format scoop-completions scripts with topiary-nushell (#1061)

This commit is contained in:
ziboh 2025-02-28 20:48:52 +08:00 committed by GitHub
parent a519391358
commit 698e240647
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -6,22 +6,22 @@
# list of supported architecture # list of supported architecture
def scoopArches [] { def scoopArches [] {
[ "32bit", "64bit" ] ["32bit" "64bit"]
} }
# list of all installed apps # list of all installed apps
def scoopInstalledApps [] { def scoopInstalledApps [] {
let localAppDir = if ('SCOOP' in $env) { let localAppDir = if ('SCOOP' in $env) {
[$env.SCOOP, 'apps'] | path join [$env.SCOOP 'apps'] | path join
} else { } else {
[$env.USERPROFILE, 'scoop', 'apps'] | path join [$env.USERPROFILE 'scoop' 'apps'] | path join
} }
let localApps = (ls $localAppDir | get name | path basename) let localApps = (ls $localAppDir | get name | path basename)
let globalAppDir = if ('SCOOP_GLOBAL' in $env) { let globalAppDir = if ('SCOOP_GLOBAL' in $env) {
[$env.SCOOP_GLOBAL, 'apps'] | path join [$env.SCOOP_GLOBAL 'apps'] | path join
} else { } else {
[$env.ProgramData, 'scoop', 'apps'] | path join [$env.ProgramData 'scoop' 'apps'] | path join
} }
let globalApps = if ($globalAppDir | path exists) { ls $globalAppDir | get name | path basename } let globalApps = if ($globalAppDir | path exists) { ls $globalAppDir | get name | path basename }
@ -36,16 +36,16 @@ def scoopInstalledAppsWithStar [] {
# list of all manifests from all buckets # list of all manifests from all buckets
def scoopAllApps [] { def scoopAllApps [] {
let bucketsDir = if ('SCOOP' in $env) { let bucketsDir = if ('SCOOP' in $env) {
[ $env.SCOOP, 'buckets' ] | path join [$env.SCOOP 'buckets'] | path join
} else { } else {
[ $env.USERPROFILE, 'scoop', 'buckets' ] | path join [$env.USERPROFILE 'scoop' 'buckets'] | path join
} }
(ls -s $bucketsDir | get name) | each {|bucket| ls ([$bucketsDir, $bucket, 'bucket'] | path join ) | get name | path parse | where extension == json | get stem } | flatten | uniq (ls -s $bucketsDir | get name) | each {|bucket| ls ([$bucketsDir $bucket 'bucket'] | path join) | get name | path parse | where extension == json | get stem } | flatten | uniq
} }
# list of all apps that are not installed # list of all apps that are not installed
def scoopAvailableApps [] { def scoopAvailableApps [] {
let all = (scoopAllApps) let all = (scoopAllApps)
let installed = (scoopInstalledApps) let installed = (scoopInstalledApps)
$all | where $it not-in $installed $all | where $it not-in $installed
@ -54,77 +54,77 @@ def scoopAvailableApps [] {
# list of all config options # list of all config options
def scoopConfigs [] { def scoopConfigs [] {
[ [
'7ZIPEXTRACT_USE_EXTERNAL', '7ZIPEXTRACT_USE_EXTERNAL'
'MSIEXTRACT_USE_LESSMSI', 'MSIEXTRACT_USE_LESSMSI'
'NO_JUNCTIONS', 'NO_JUNCTIONS'
'SCOOP_REPO', 'SCOOP_REPO'
'SCOOP_BRANCH', 'SCOOP_BRANCH'
'proxy', 'proxy'
'default_architecture', 'default_architecture'
'debug', 'debug'
'force_update', 'force_update'
'show_update_log', 'show_update_log'
'manifest_review', 'manifest_review'
'shim', 'shim'
'rootPath', 'rootPath'
'globalPath', 'globalPath'
'cachePath', 'cachePath'
'gh_token', 'gh_token'
'virustotal_api_key', 'virustotal_api_key'
'cat_style', 'cat_style'
'ignore_running_processes', 'ignore_running_processes'
'private_hosts', 'private_hosts'
'aria2-enabled', 'aria2-enabled'
'aria2-warning-enabled', 'aria2-warning-enabled'
'aria2-retry-wait', 'aria2-retry-wait'
'aria2-split', 'aria2-split'
'aria2-max-connection-per-server', 'aria2-max-connection-per-server'
'aria2-min-split-size', 'aria2-min-split-size'
'aria2-options', 'aria2-options'
] ]
} }
# boolean as strings # boolean as strings
def scoopBooleans [] { def scoopBooleans [] {
["'true'", "'false'"] ["'true'" "'false'"]
} }
def scoopRepos [] { def scoopRepos [] {
[ [
'https://github.com/ScoopInstaller/Scoop', 'https://github.com/ScoopInstaller/Scoop'
] ]
} }
def scoopBranches [] { def scoopBranches [] {
['master', 'develop'] ['master' 'develop']
} }
def scoopShimBuilds [] { def scoopShimBuilds [] {
[ 'kiennq', 'scoopcs', '71'] ['kiennq' 'scoopcs' '71']
} }
def scoopCommands [] { def scoopCommands [] {
let libexecDir = if ('SCOOP' in $env) { let libexecDir = if ('SCOOP' in $env) {
[ $env.SCOOP, 'apps', 'scoop', 'current', 'libexec' ] | path join [$env.SCOOP 'apps' 'scoop' 'current' 'libexec'] | path join
} else { } else {
[ $env.USERPROFILE, 'scoop', 'apps', 'scoop', 'current', 'libexec' ] | path join [$env.USERPROFILE 'scoop' 'apps' 'scoop' 'current' 'libexec'] | path join
} }
let commands = ( let commands = (
ls $libexecDir ls $libexecDir
| each {|command| | each {|command|
[ [
[value, description]; [value description];
[ [
# eg. scoop-help.ps1 -> help # eg. scoop-help.ps1 -> help
($command.name | path parse | get stem |str substring 6..), ($command.name | path parse | get stem | str substring 6..)
# second line is starts with '# Summary: ' # second line is starts with '# Summary: '
# eg. '# Summary: Install apps' -> 'Install apps' # eg. '# Summary: Install apps' -> 'Install apps'
(open $command.name | lines | skip 1 | first | str substring 11..) (open $command.name | lines | skip 1 | first | str substring 11..)
] ]
] ]
} }
| flatten | flatten
) )
$commands $commands
} }
@ -134,15 +134,15 @@ def scoopAliases [] {
} }
def batStyles [] { def batStyles [] {
[ 'default', 'auto', 'full', 'plain', 'changes', 'header', 'header-filename', 'header-filesize', 'grid', 'rule', 'numbers', 'snip' ] ['default' 'auto' 'full' 'plain' 'changes' 'header' 'header-filename' 'header-filesize' 'grid' 'rule' 'numbers' 'snip']
} }
def scoopShims [] { def scoopShims [] {
let localShimDir = if ('SCOOP' in $env) { [ $env.SCOOP, 'shims' ] | path join } else if (scoop config root_path | path exists) { scoop config root_path } else { [ $env.USERPROFILE, 'scoop', 'shims' ] | path join } let localShimDir = if ('SCOOP' in $env) { [$env.SCOOP 'shims'] | path join } else if (scoop config root_path | path exists) { scoop config root_path } else { [$env.USERPROFILE 'scoop' 'shims'] | path join }
let localShims = if ($localShimDir | path exists) { ls $localShimDir | get name | path parse | select stem extension | where extension == shim | get stem } else { [] } let localShims = if ($localShimDir | path exists) { ls $localShimDir | get name | path parse | select stem extension | where extension == shim | get stem } else { [] }
let globalShimDir = if ('SCOOP_GLOBAL' in $env) { [ $env.SCOOP_GLOBAL, 'shims' ] | path join } else if (scoop config global_path | path exists) { scoop config global_path } else { [ $env.ProgramData, 'scoop', 'shims' ] | path join } let globalShimDir = if ('SCOOP_GLOBAL' in $env) { [$env.SCOOP_GLOBAL 'shims'] | path join } else if (scoop config global_path | path exists) { scoop config global_path } else { [$env.ProgramData 'scoop' 'shims'] | path join }
let globalShims = if ($globalShimDir | path exists) { ls $globalShimDir | get name | path parse | select stem extension | where extension == shim | get stem } else { [] } let globalShims = if ($globalShimDir | path exists) { ls $globalShimDir | get name | path parse | select stem extension | where extension == shim | get stem } else { [] }
$localShims | append $globalShims | uniq | sort $localShims | append $globalShims | uniq | sort
} }
@ -153,9 +153,9 @@ def scoopShims [] {
# Windows command line installer # Windows command line installer
export extern "scoop" [ export extern "scoop" [
alias?: string@scoopCommands # available scoop commands and aliases alias?: string@scoopCommands # available scoop commands and aliases
--help(-h) # Show help for this command. --help (-h) # Show help for this command.
--version(-v) # Show current scoop and added buckets versions --version (-v) # Show current scoop and added buckets versions
] ]
################################################################ ################################################################
@ -165,7 +165,7 @@ export extern "scoop" [
# Lists all installed apps, or the apps matching the supplied query. # Lists all installed apps, or the apps matching the supplied query.
export extern "scoop list" [ export extern "scoop list" [
query?: string@scoopInstalledApps # string that will be matched query?: string@scoopInstalledApps # string that will be matched
--help(-h) # Show help for this command. --help (-h) # Show help for this command.
] ]
################################################################ ################################################################
@ -175,9 +175,9 @@ export extern "scoop list" [
# Uninstall specified application(s). # Uninstall specified application(s).
export extern "scoop uninstall" [ export extern "scoop uninstall" [
...app: string@scoopInstalledApps # app that will be uninstalled ...app: string@scoopInstalledApps # app that will be uninstalled
--help(-h) # Show help for this command. --help (-h) # Show help for this command.
--global(-g) # Uninstall a globally installed application(s). --global (-g) # Uninstall a globally installed application(s).
--purge(-p) # Persisted data will be removed. Normally when application is being uninstalled, the data defined in persist property/manually persisted are kept. --purge (-p) # Persisted data will be removed. Normally when application is being uninstalled, the data defined in persist property/manually persisted are kept.
] ]
################################################################ ################################################################
@ -187,10 +187,10 @@ export extern "scoop uninstall" [
# Perform cleanup on specified installed application(s) by removing old/not actively used versions. # Perform cleanup on specified installed application(s) by removing old/not actively used versions.
export extern "scoop cleanup" [ export extern "scoop cleanup" [
...app: string@scoopInstalledAppsWithStar # app that will be cleaned ...app: string@scoopInstalledAppsWithStar # app that will be cleaned
--help(-h) # Show help for this command. --help (-h) # Show help for this command.
--all(-a) # Cleanup all apps (alternative to '*') --all (-a) # Cleanup all apps (alternative to '*')
--global(-g) # Perform cleanup on globally installed application(s). (Include them if '*' is used) --global (-g) # Perform cleanup on globally installed application(s). (Include them if '*' is used)
--cache(-k) # Remove outdated download cache. This will keep only the latest version cached. --cache (-k) # Remove outdated download cache. This will keep only the latest version cached.
] ]
################################################################ ################################################################
@ -200,8 +200,8 @@ export extern "scoop cleanup" [
# Display information about an application. # Display information about an application.
export extern "scoop info" [ export extern "scoop info" [
app: string@scoopAllApps # app that will be questioned app: string@scoopAllApps # app that will be questioned
--verbose(-v) # Show full paths and URLs --verbose (-v) # Show full paths and URLs
--help(-h) # Show help for this command. --help (-h) # Show help for this command.
] ]
################################################################ ################################################################
@ -211,14 +211,14 @@ export extern "scoop info" [
# Update installed application(s), or scoop itself. # Update installed application(s), or scoop itself.
export extern "scoop update" [ export extern "scoop update" [
...app: string@scoopInstalledAppsWithStar # which apps ...app: string@scoopInstalledAppsWithStar # which apps
--help(-h) # Show help for this command. --help (-h) # Show help for this command.
--force(-f) # Force update even when there is not a newer version. --force (-f) # Force update even when there is not a newer version.
--global(-g) # Update a globally installed application(s). --global (-g) # Update a globally installed application(s).
--independent(-i) # Do not install dependencies automatically. --independent (-i) # Do not install dependencies automatically.
--no-cache(-k) # Do not use the download cache. --no-cache (-k) # Do not use the download cache.
--skip(-s) # Skip hash validation (use with caution!). --skip (-s) # Skip hash validation (use with caution!).
--quiet(-q) # Hide extraneous messages. --quiet (-q) # Hide extraneous messages.
--all(-a) # Update all apps (alternative to '*') --all (-a) # Update all apps (alternative to '*')
] ]
################################################################ ################################################################
@ -228,13 +228,13 @@ export extern "scoop update" [
# Install specific application(s). # Install specific application(s).
export extern "scoop install" [ export extern "scoop install" [
...app: string@scoopAvailableApps # which apps ...app: string@scoopAvailableApps # which apps
--arch(-a): string@scoopArches # Use the specified architecture, if the application's manifest supports it. --arch (-a): string@scoopArches # Use the specified architecture, if the application's manifest supports it.
--help(-h) # Show help for this command. --help (-h) # Show help for this command.
--global(-g) # Install the application(s) globally. --global (-g) # Install the application(s) globally.
--independent(-i) # Do not install dependencies automatically. --independent (-i) # Do not install dependencies automatically.
--no-cache(-k) # Do not use the download cache. --no-cache (-k) # Do not use the download cache.
--skip(-s) # Skip hash validation (use with caution!). --skip (-s) # Skip hash validation (use with caution!).
--no-update-scoop(-u) # Don't update Scoop before installing if it's outdated --no-update-scoop (-u) # Don't update Scoop before installing if it's outdated
] ]
################################################################ ################################################################
@ -243,8 +243,8 @@ export extern "scoop install" [
# Show status and check for new app versions. # Show status and check for new app versions.
export extern "scoop status" [ export extern "scoop status" [
--help(-h) # Show help for this command. --help (-h) # Show help for this command.
--local(-l) # Checks the status for only the locally installed apps, and disables remote fetching/checking for Scoop and buckets --local (-l) # Checks the status for only the locally installed apps, and disables remote fetching/checking for Scoop and buckets
] ]
################################################################ ################################################################
@ -253,7 +253,7 @@ export extern "scoop status" [
# Show help for scoop # Show help for scoop
export extern "scoop help" [ export extern "scoop help" [
--help(-h) # Show help for this command. --help (-h) # Show help for this command.
command?: string@scoopCommands # Show help for the specified command command?: string@scoopCommands # Show help for the specified command
] ]
@ -264,19 +264,19 @@ export extern "scoop help" [
# Add, remove or list Scoop aliases # Add, remove or list Scoop aliases
export extern "scoop alias" [ export extern "scoop alias" [
--help(-h) # Show help for this command. --help (-h) # Show help for this command.
] ]
# add an alias # add an alias
export extern "scoop alias add" [ export extern "scoop alias add" [
name: string # name of the alias name: string # name of the alias
command: string # scoop command command: string # scoop command
description: string # description of the alias description: string # description of the alias
] ]
# list all aliases # list all aliases
export extern "scoop alias list" [ export extern "scoop alias list" [
--verbose(-v) # Show alias description and table headers (works only for 'list') --verbose (-v) # Show alias description and table headers (works only for 'list')
] ]
# remove an alias # remove an alias
@ -284,50 +284,47 @@ export extern "scoop alias rm" [
...name: string@scoopAliases # alias that will be removed ...name: string@scoopAliases # alias that will be removed
] ]
################################################################ ################################################################
# scoop shim # scoop shim
################################################################ ################################################################
# Manipulate Scoop shims # Manipulate Scoop shims
export extern "scoop shim" [ export extern "scoop shim" [
--help(-h) # Show help for this command. --help (-h) # Show help for this command.
] ]
# add a custom shim # add a custom shim
export extern "scoop shim add" [ export extern "scoop shim add" [
shim_name: string # name of the shim shim_name: string # name of the shim
command_path: path # path to executable command_path: path # path to executable
...cmd_args # additional command arguments ...cmd_args # additional command arguments
--global(-g) # Manipulate global shim(s) --global (-g) # Manipulate global shim(s)
] ]
# remove shims (CAUTION: this could remove shims added by an app manifest) # remove shims (CAUTION: this could remove shims added by an app manifest)
export extern "scoop shim rm" [ export extern "scoop shim rm" [
...shim_name: string@scoopShims # shim that will be removed ...shim_name: string@scoopShims # shim that will be removed
--global(-g) # Manipulate global shim(s) --global (-g) # Manipulate global shim(s)
] ]
# list all shims or matching shims # list all shims or matching shims
export extern "scoop shim list" [ export extern "scoop shim list" [
pattern?: string # list only matching shims pattern?: string # list only matching shims
--global(-g) # Manipulate global shim(s) --global (-g) # Manipulate global shim(s)
] ]
# show a shim's information # show a shim's information
export extern "scoop shim info" [ export extern "scoop shim info" [
shim_name: string@scoopShims # shim info to retrieve shim_name: string@scoopShims # shim info to retrieve
--global(-g) # Manipulate global shim(s) --global (-g) # Manipulate global shim(s)
] ]
# alternate a shim's target source # alternate a shim's target source
export extern "scoop shim alter" [ export extern "scoop shim alter" [
shim_name: string@scoopShims # shim that will be alternated shim_name: string@scoopShims # shim that will be alternated
--global(-g) # Manipulate global shim(s) --global (-g) # Manipulate global shim(s)
] ]
################################################################ ################################################################
# scoop which # scoop which
################################################################ ################################################################
@ -335,7 +332,7 @@ export extern "scoop shim alter" [
# Locate the path to a shim/executable that was installed with Scoop (similar to 'which' on Linux) # Locate the path to a shim/executable that was installed with Scoop (similar to 'which' on Linux)
export extern "scoop which" [ export extern "scoop which" [
command: string # executable name with .exe command: string # executable name with .exe
--help(-h) # Show help for this command. --help (-h) # Show help for this command.
] ]
################################################################ ################################################################
@ -345,7 +342,7 @@ export extern "scoop which" [
# Show content of specified manifest. # Show content of specified manifest.
export extern "scoop cat" [ export extern "scoop cat" [
app: string@scoopAllApps # app that will be shown app: string@scoopAllApps # app that will be shown
--help(-h) # Show help for this command. --help (-h) # Show help for this command.
] ]
################################################################ ################################################################
@ -354,7 +351,7 @@ export extern "scoop cat" [
# Performs a series of diagnostic tests to try to identify things that may cause problems with Scoop. # Performs a series of diagnostic tests to try to identify things that may cause problems with Scoop.
export extern "scoop checkup" [ export extern "scoop checkup" [
--help(-h) # Show help for this command. --help (-h) # Show help for this command.
] ]
################################################################ ################################################################
@ -364,7 +361,7 @@ export extern "scoop checkup" [
# Opens the app homepage # Opens the app homepage
export extern "scoop home" [ export extern "scoop home" [
app: string@scoopAllApps # app that will be shown app: string@scoopAllApps # app that will be shown
--help(-h) # Show help for this command. --help (-h) # Show help for this command.
] ]
################################################################ ################################################################
@ -373,7 +370,7 @@ export extern "scoop home" [
# Get or set configuration values # Get or set configuration values
export extern "scoop config" [ export extern "scoop config" [
--help(-h) # Show help for this command. --help (-h) # Show help for this command.
] ]
# External 7zip (from path) will be used for archives extraction. # External 7zip (from path) will be used for archives extraction.
@ -523,8 +520,8 @@ export extern "scoop config rm" [
# Hold an app to disable updates # Hold an app to disable updates
export extern "scoop hold" [ export extern "scoop hold" [
app: string@scoopInstalledApps # app that will be hold back app: string@scoopInstalledApps # app that will be hold back
--global(-g) # Hold globally installed apps --global (-g) # Hold globally installed apps
--help(-h) # Show help for this command. --help (-h) # Show help for this command.
] ]
################################################################ ################################################################
@ -534,8 +531,8 @@ export extern "scoop hold" [
# Unhold an app to enable updates # Unhold an app to enable updates
export extern "scoop unhold" [ export extern "scoop unhold" [
app: string@scoopInstalledApps # app that will be unhold back app: string@scoopInstalledApps # app that will be unhold back
--global(-g) # Unhold globally installed apps --global (-g) # Unhold globally installed apps
--help(-h) # Show help for this command. --help (-h) # Show help for this command.
] ]
################################################################ ################################################################
@ -544,9 +541,9 @@ export extern "scoop unhold" [
# List dependencies for an app, in the order they'll be installed # List dependencies for an app, in the order they'll be installed
export extern "scoop depends" [ export extern "scoop depends" [
app: string@scoopAllApps # app in question app: string@scoopAllApps # app in question
--arch(-a): string@scoopArches # Use the specified architecture, if the application's manifest supports it. --arch (-a): string@scoopArches # Use the specified architecture, if the application's manifest supports it.
--help(-h) # Show help for this command. --help (-h) # Show help for this command.
] ]
################################################################ ################################################################
@ -555,8 +552,8 @@ export extern "scoop depends" [
# Exports installed apps, buckets (and optionally configs) in JSON format # Exports installed apps, buckets (and optionally configs) in JSON format
export extern "scoop export" [ export extern "scoop export" [
--config(-c) # Export the Scoop configuration file too --config (-c) # Export the Scoop configuration file too
--help(-h) # Show help for this command. --help (-h) # Show help for this command.
] ]
################################################################ ################################################################
@ -566,7 +563,7 @@ export extern "scoop export" [
# Imports apps, buckets and configs from a Scoopfile in JSON format # Imports apps, buckets and configs from a Scoopfile in JSON format
export extern "scoop import" [ export extern "scoop import" [
file: path # path to Scoopfile file: path # path to Scoopfile
--help(-h) # Show help for this command. --help (-h) # Show help for this command.
] ]
################################################################ ################################################################
@ -576,8 +573,8 @@ export extern "scoop import" [
# Reset an app to resolve conflicts # Reset an app to resolve conflicts
export extern "scoop reset" [ export extern "scoop reset" [
app: string@scoopInstalledAppsWithStar # app that will be reset app: string@scoopInstalledAppsWithStar # app that will be reset
--all(-a) # Reset all apps. (alternative to '*') --all (-a) # Reset all apps. (alternative to '*')
--help(-h) # Show help for this command. --help (-h) # Show help for this command.
] ]
################################################################ ################################################################
@ -587,7 +584,7 @@ export extern "scoop reset" [
# Returns the path to the specified app # Returns the path to the specified app
export extern "scoop prefix" [ export extern "scoop prefix" [
app: string@scoopInstalledApps # app in question app: string@scoopInstalledApps # app in question
--help(-h) # Show help for this command. --help (-h) # Show help for this command.
] ]
################################################################ ################################################################
@ -597,7 +594,7 @@ export extern "scoop prefix" [
# Create a custom app manifest # Create a custom app manifest
export extern "scoop create" [ export extern "scoop create" [
url: string # url of manifest url: string # url of manifest
--help(-h) # Show help for this command. --help (-h) # Show help for this command.
] ]
################################################################ ################################################################
@ -607,7 +604,7 @@ export extern "scoop create" [
# Search available apps # Search available apps
export extern "scoop search" [ export extern "scoop search" [
query?: string # Show app names that match the query query?: string # Show app names that match the query
--help(-h) # Show help for this command. --help (-h) # Show help for this command.
] ]
################################################################ ################################################################
@ -616,19 +613,19 @@ export extern "scoop search" [
# Show the download cache # Show the download cache
export extern "scoop cache" [ export extern "scoop cache" [
...?apps: string@scoopInstalledAppsWithStar # apps in question ...apps: string@scoopInstalledAppsWithStar # apps in question
--help(-h) # Show help for this command. --help (-h) # Show help for this command.
] ]
# Show the download cache # Show the download cache
export extern "scoop cache show" [ export extern "scoop cache show" [
...?apps: string@scoopInstalledAppsWithStar # apps in question ...apps: string@scoopInstalledAppsWithStar # apps in question
] ]
# Clear the download cache # Clear the download cache
export extern "scoop cache rm" [ export extern "scoop cache rm" [
...?apps: string@scoopInstalledAppsWithStar # apps in question ...apps: string@scoopInstalledAppsWithStar # apps in question
--all(-a) # Clear all apps (alternative to '*') --all (-a) # Clear all apps (alternative to '*')
] ]
################################################################ ################################################################
@ -638,11 +635,11 @@ export extern "scoop cache rm" [
# Download apps in the cache folder and verify hashes # Download apps in the cache folder and verify hashes
export extern "scoop download" [ export extern "scoop download" [
app?: string@scoopAvailableApps # apps in question app?: string@scoopAvailableApps # apps in question
--help(-h) # Show help for this command. --help (-h) # Show help for this command.
--force(-f) # Force download (overwrite cache) --force (-f) # Force download (overwrite cache)
--no-hash-check(-h) # Skip hash verification (use with caution!) --no-hash-check (-h) # Skip hash verification (use with caution!)
--no-update-scoop(-u) # Don't update Scoop before downloading if it's outdated --no-update-scoop (-u) # Don't update Scoop before downloading if it's outdated
--arch(-a): string@scoopArches # Use the specified architecture, if the app supports it --arch (-a): string@scoopArches # Use the specified architecture, if the app supports it
] ]
################################################################ ################################################################
@ -650,14 +647,14 @@ export extern "scoop download" [
################################################################ ################################################################
def scoopKnownBuckets [] { def scoopKnownBuckets [] {
[ "main", "extras", "versions", "nirsoft", "php", "nerd-fonts", "nonportable", "java", "games", "sysinternals" ] ["main" "extras" "versions" "nirsoft" "php" "nerd-fonts" "nonportable" "java" "games" "sysinternals"]
} }
def scoopInstalledBuckets [] { def scoopInstalledBuckets [] {
let bucketsDir = if ('SCOOP' in $env) { let bucketsDir = if ('SCOOP' in $env) {
[ $env.SCOOP, 'buckets' ] | path join [$env.SCOOP 'buckets'] | path join
} else { } else {
[ $env.USERPROFILE, 'scoop', 'buckets' ] | path join [$env.USERPROFILE 'scoop' 'buckets'] | path join
} }
let buckets = (ls $bucketsDir | get name | path basename) let buckets = (ls $bucketsDir | get name | path basename)
@ -665,7 +662,7 @@ def scoopInstalledBuckets [] {
} }
def scoopAvailableBuckets [] { def scoopAvailableBuckets [] {
let known = (scoopKnownBuckets) let known = (scoopKnownBuckets)
let installed = (scoopInstalledBuckets) let installed = (scoopInstalledBuckets)
$known | where $it not-in $installed $known | where $it not-in $installed
@ -673,30 +670,30 @@ def scoopAvailableBuckets [] {
# Add, list or remove buckets. # Add, list or remove buckets.
export extern "scoop bucket" [ export extern "scoop bucket" [
--help(-h) # Show help for this command. --help (-h) # Show help for this command.
] ]
# add a bucket # add a bucket
export extern "scoop bucket add" [ export extern "scoop bucket add" [
name: string@scoopAvailableBuckets # name of the bucket name: string@scoopAvailableBuckets # name of the bucket
repo?: string # url of git repo repo?: string # url of git repo
--help(-h) # Show help for this command. --help (-h) # Show help for this command.
] ]
# list installed buckets # list installed buckets
export extern "scoop bucket list" [ export extern "scoop bucket list" [
--help(-h) # Show help for this command. --help (-h) # Show help for this command.
] ]
# list known buckets # list known buckets
export extern "scoop bucket known" [ export extern "scoop bucket known" [
--help(-h) # Show help for this command. --help (-h) # Show help for this command.
] ]
# remove installed buckets # remove installed buckets
export extern "scoop bucket rm" [ export extern "scoop bucket rm" [
name: string@scoopInstalledBuckets # bucket to be removed name: string@scoopInstalledBuckets # bucket to be removed
--help(-h) # Show help for this command. --help (-h) # Show help for this command.
] ]
################################################################ ################################################################
@ -706,10 +703,10 @@ export extern "scoop bucket rm" [
# Look for app's hash or url on virustotal.com # Look for app's hash or url on virustotal.com
export extern "scoop virustotal" [ export extern "scoop virustotal" [
...apps: string@scoopInstalledAppsWithStar # app to be scanned ...apps: string@scoopInstalledAppsWithStar # app to be scanned
--all(-a) # Check for all installed apps --all (-a) # Check for all installed apps
--scan(-s) # Send download URL for analysis (and future retrieval). --scan (-s) # Send download URL for analysis (and future retrieval).
--no-depends(-n) # By default, all dependencies are checked too. This flag avoids it. --no-depends (-n) # By default, all dependencies are checked too. This flag avoids it.
--no-update-scoop(-u) # Don't update Scoop before checking if it's outdated --no-update-scoop (-u) # Don't update Scoop before checking if it's outdated
--passthru(-p) # Return reports as objects --passthru (-p) # Return reports as objects
--help(-h) # Show help for this command. --help (-h) # Show help for this command.
] ]