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

reorganize site in preparation for beta and releaes (#161)

This commit is contained in:
Darren Schroeder 2022-02-25 13:10:38 -06:00 committed by GitHub
parent 7b76a8e662
commit ca89da5242
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
155 changed files with 1402 additions and 763 deletions

View file

@ -0,0 +1,5 @@
# Cargo Custom Completions
### Definition
These scripts should be used to demonstrate how create custom completions for cargo.

View file

@ -0,0 +1,51 @@
## Written by lukexor
def "nu-complete cargo bins" [] {
let $bins = (ls src | where name =~ bin | each { |f| ls -s $f.name } | flatten | where name =~ .rs || type == dir)
if ($bins | length) > 0 {
echo $bins | update name { |file| $file.name | str find-replace ".rs" "" } | get name
}
}
def "nu-complete cargo examples" [] {
let $examples = (ls | where name =~ examples | each { |f| ls -s $f.name } | flatten | where name =~ .rs || type == dir)
if ($examples | length) > 0 {
echo $examples | update name { |file| $file.name | str find-replace ".rs" "" } | get name
}
}
def "nu-complete cargo profiles" [] {
open Cargo.toml | get profile | transpose | get column0
}
def "nu-complete cargo features" [] {
open Cargo.toml | get features | transpose | get column0
}
extern "cargo run" [
...args: any # arguments
--bin: string@"nu-complete cargo bins" # Name of the bin target to run
--example: string@"nu-complete cargo examples" # Name of the example target to run
--quiet(-q) # Do not print cargo log messages
--package(-p): string # Package with the target to run
--jobs(-j): number # Number of parallel jobs, defaults to # of CPUs
--release # Build artifacts in release mode, with optimizations
--profile: string@"nu-complete cargo profiles" # Build artifacts with the specified profile
--features: string@"nu-complete cargo features"# Space or comma separated list of features to activate
--all-features # Activate all available features
--no-default-features # Do not activate the `default` feature
--target: string # Build for the target triple
--target-dir: path # Directory for all generated artifacts
--manifest-path: path # Path to Cargo.toml
--message-format: string # Error format
--unit-graph # Output build graph in JSON (unstable)
--ignore-rust-version # Ignore `rust-version` specification in packages
--verbose(-v) # Use verbose output (-vv very verbose/build.rs output)
--color: string # Coloring: auto, always, never
--frozen # Require Cargo.lock and cache are up to date
--locked # Require Cargo.lock is up to date
--offline # Run without accessing the network
--config: string # Override a configuration value (unstable)
-Z: string # Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details
--help(-h) # Prints help information
]

View file

@ -0,0 +1,5 @@
# Git Custom Completions
### Definition
These scripts should be used to demonstrate how create custom completions for git.

View file

@ -0,0 +1,71 @@
# Written by JT
def "nu-complete git branches" [] {
^git branch | lines | each { |line| $line | str find-replace "\* " "" | str trim }
}
def "nu-complete git remotes" [] {
^git remote | lines | each { |line| $line | str trim }
}
# Top leve git command
extern "git" [
]
# Check out git branches ans files
extern "git co" [
branch?: string@"nu-complete git branches" # name of the branch to checkout
-b: string # create and checkout a new branch
-B: string # create/reset and checkout a branch
-l # create reflog for new branch
--guess # second guess 'git checkout <no-such-branch>' (default)
--overlay # use overlay mode (default)
--quiet(-q) # suppress progress reporting
--recurse-submodules: string # control recursive updating of submodules
--progress # force progress reporting
--merge(-m) # perform a 3-way merge with the new branch
--conflict: string # conflict style (merge or diff3)
--detach(-d) # detach HEAD at named commit
--track(-t) # set upstream info for new branch
--force(-f) # force checkout (throw away local modifications)
--orphan: string # new unparented branch
--overwrite-ignore # update ignored files (default)
--ignore-other-worktrees # do not check if another worktree is holding the given ref
--ours(-2) # checkout our version for unmerged files
--theirs(-3) # checkout their version for unmerged files
--patch(-p) # select hunks interactively
--ignore-skip-worktree-bits # do not limit pathspecs to sparse entries only
--pathspec-from-file: string # read pathspec from file
]
# Push changes
extern "git pu" [
remote?: string@"nu-complete git remotes", # the name of the remote
refspec?: string@"nu-complete git branches"# the branch / refspec
--verbose(-v) # be more verbose
--quiet(-q) # be more quiet
--repo: string # repository
--all # push all refs
--mirror # mirror all refs
--delete(-d) # delete refs
--tags # push tags (can't be used with --all or --mirror)
--dry-run(-n) # dry run
--porcelain # machine-readable output
--force(-f) # force updates
--force-with-lease: string # require old value of ref to be at this value
--recurse-submodules: string # control recursive pushing of submodules
--thin # use thin pack
--receive-pack: string # receive pack program
--exec: string # receive pack program
--set-upstream(-u) # set upstream for git pull/status
--progress # force progress reporting
--prune # prune locally removed refs
--no-verify # bypass pre-push hook
--follow-tags # push missing but relevant tags
--signed: string # GPG sign the push
--atomic # request atomic transaction on remote side
--push-option(-o): string # option to transmit
--ipv4(-4) # use IPv4 addresses only
--ipv6(-6) # use IPv6 addresses only
]

View file

@ -0,0 +1,5 @@
# Winget Custom Completions
### Definition
These scripts should be used to demonstrate how create custom completions for winget.

View file

@ -0,0 +1,13 @@
# Written by Genna
# Manage sources of packages
extern "winget source" [
--help(-?): bool # Display the help for this command
]
# Windows Package Manager
extern winget [
--version(-v): bool, # Display the version of the tool
--info: bool, # Display general info of the tool
--help(-?): bool, # Display the help for this command
]