1
Fork 0
mirror of https://github.com/RGBCube/nu_scripts synced 2025-08-01 14:47:47 +00:00

custom completions: scoop: adds some missing command completions (#281)

this commit adds scoop commands that are:
- bucket
- cache
- create
- depends
- download
- export
- hold
- import
- prefix
- reset
- unhold
- virustotal
This commit is contained in:
e2dk4r 2022-08-25 13:54:36 +00:00 committed by GitHub
parent 87937cb86f
commit ff5cf0e96d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 202 additions and 15 deletions

View file

@ -18,30 +18,30 @@ With `path/to` being either the relative path of the file to your current workin
| ? | Command | Summary |
|---|------------|------------------------------------------------------------------------------------------------|
| - | alias | Manage scoop aliases |
| - | bucket | Manage Scoop buckets |
| - | cache | Show or clear the download cache |
| - | cat | Show content of specified manifest. If available, `bat` will be used to pretty-print the JSON. |
| - | checkup | Check for potential problems |
| x | bucket | Manage Scoop buckets |
| x | cache | Show or clear the download cache |
| x | cat | Show content of specified manifest. If available, `bat` will be used to pretty-print the JSON. |
| x | checkup | Check for potential problems |
| x | cleanup | Cleanup apps by removing old versions |
| x | config | Get or set configuration values |
| - | create | Create a custom app manifest |
| - | depends | List dependencies for an app, in the order they'll be installed |
| - | download | Download apps in the cache folder and verify hashes |
| - | export | Exports installed apps, buckets (and optionally configs) in JSON format |
| x | create | Create a custom app manifest |
| x | depends | List dependencies for an app, in the order they'll be installed |
| x | download | Download apps in the cache folder and verify hashes |
| x | export | Exports installed apps, buckets (and optionally configs) in JSON format |
| - | help | Show help for a command |
| - | hold | Hold an app to disable updates |
| x | hold | Hold an app to disable updates |
| x | home | Opens the app homepage |
| - | import | Imports apps, buckets and configs from a Scoopfile in JSON format |
| x | import | Imports apps, buckets and configs from a Scoopfile in JSON format |
| x | info | Display information about an app |
| x | install | Install apps |
| x | list | List installed apps |
| - | prefix | Returns the path to the specified app |
| - | reset | Reset an app to resolve conflicts |
| - | search | Search available apps |
| x | prefix | Returns the path to the specified app |
| x | reset | Reset an app to resolve conflicts |
| x | search | Search available apps |
| - | shim | Manipulate Scoop shims |
| x | status | Show status and check for new app versions |
| - | unhold | Unhold an app to enable updates |
| x | unhold | Unhold an app to enable updates |
| x | uninstall | Uninstall an app |
| x | update | Update apps, or Scoop itself |
| - | virustotal | Look for app's hash or url on virustotal.com |
| x | virustotal | Look for app's hash or url on virustotal.com |
| x | which | Locate a shim/executable (similar to 'which' on Linux) |

View file

@ -384,3 +384,190 @@ export extern "scoop config aria2-options" [
export extern "scoop config rm" [
name: string@scoopConfigs # app that will be removed
]
################################################################
# scoop hold
################################################################
# Hold an app to disable updates
export extern "scoop hold" [
app: string@scoopInstalledApps # app that will be hold back
--global(-g) # Hold globally installed apps
--help(-h) # Show help for this command.
]
################################################################
# scoop unhold
################################################################
# Unhold an app to enable updates
export extern "scoop unhold" [
app: string@scoopInstalledApps # app that will be unhold back
--global(-g) # Unhold globally installed apps
--help(-h) # Show help for this command.
]
################################################################
# scoop depends
################################################################
# List dependencies for an app, in the order they'll be installed
export extern "scoop depends" [
app: string@scoopAllApps # app in question
--arch(-a): string@scoopArches # Use the specified architecture, if the application's manifest supports it.
--help(-h) # Show help for this command.
]
################################################################
# scoop export
################################################################
# Exports installed apps, buckets (and optionally configs) in JSON format
export extern "scoop export" [
--config(-c) # Export the Scoop configuration file too
--help(-h) # Show help for this command.
]
################################################################
# scoop import
################################################################
# Imports apps, buckets and configs from a Scoopfile in JSON format
export extern "scoop import" [
file: path # path to Scoopfile
--help(-h) # Show help for this command.
]
################################################################
# scoop reset
################################################################
# Reset an app to resolve conflicts
export extern "scoop reset" [
app: string@scoopInstalledAppsWithStar # app that will be reset
--all(-a) # Reset all apps. (alternative to '*')
--help(-h) # Show help for this command.
]
################################################################
# scoop prefix
################################################################
# Returns the path to the specified app
export extern "scoop prefix" [
app: string@scoopInstalledApps # app in question
--help(-h) # Show help for this command.
]
################################################################
# scoop create
################################################################
# Create a custom app manifest
export extern "scoop create" [
url: string # url of manifest
--help(-h) # Show help for this command.
]
################################################################
# scoop search
################################################################
# Search available apps
export extern "scoop search" [
query?: string # Show app names that match the query
--help(-h) # Show help for this command.
]
################################################################
# scoop cache ...
################################################################
# Show the download cache
export extern "scoop cache show" [
...?apps: string@scoopInstalledAppsWithStar # apps in question
]
# Clear the download cache
export extern "scoop cache rm" [
...?apps: string@scoopInstalledAppsWithStar # apps in question
--all(-a) # Clear all apps (alternative to '*')
]
################################################################
# scoop download
################################################################
# Download apps in the cache folder and verify hashes
export extern "scoop download" [
app?: string@scoopAvailableApps # apps in question
--help(-h) # Show help for this command.
--force(-f) # Force download (overwrite cache)
--no-hash-check(-h) # Skip hash verification (use with caution!)
--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
]
################################################################
# scoop bucket ...
################################################################
def scoopKnownBuckets [] {
[ "main", "extras", "versions", "nirsoft", "php", "nerd-fonts", "nonportable", "java", "games" ]
}
def scoopInstalledBuckets [] {
let bucketsDir = if (env | any? $it.name == 'SCOOP') { $"($env.SCOOP)\\buckets" } else { $"($env.USERPROFILE)\\scoop\\buckets" }
let buckets = (ls $bucketsDir | get name | path basename)
$buckets
}
def scoopAvailableBuckets [] {
let known = (scoopKnownBuckets)
let installed = (scoopInstalledBuckets)
$known | where not $it in $installed
}
# Add, list or remove buckets.
export extern "scoop bucket" [
--help(-h) # Show help for this command.
]
# add a bucket
export extern "scoop bucket add" [
name: string@scoopAvailableBuckets # name of the bucket
repo?: string # url of git repo
--help(-h) # Show help for this command.
]
# list installed buckets
export extern "scoop bucket list" [
--help(-h) # Show help for this command.
]
# list known buckets
export extern "scoop bucket known" [
--help(-h) # Show help for this command.
]
# remove installed buckets
export extern "scoop bucket rm" [
name: string@scoopInstalledBuckets # bucket to be removed
--help(-h) # Show help for this command.
]
################################################################
# scoop virustotal
################################################################
# Look for app's hash or url on virustotal.com
export extern "scoop virustotal" [
...apps: string@scoopInstalledAppsWithStar # app to be scanned
--all(-a) # Check for all installed apps
--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-update-scoop(-u) # Don't update Scoop before checking if it's outdated
--passthru(-p) # Return reports as objects
--help(-h) # Show help for this command.
]