mirror of
https://github.com/RGBCube/nu_scripts
synced 2025-08-01 06:37:46 +00:00
Experimental multi-taskrunner support for jx
(npm for example) (#492)
* Experimental multi-task runner support for `jx` (npm for example) - Remove `nu-complete` export for debugging. - Formatting `nu-complete just recipes` * Use `jx` to override `j`. Only for `just`, it only adds a prefix when completing, and does not break the original workflow * `nu-complete just recipes` append empty string When all the completions are `just xxx`, there is only `just` in the menu, press `C-w` to delete backwards to work. * kgp takes `-o default` by default move just to just/just.nu * `gp` uses `git pull` instead of `git fetch` by default, and there is only one request when `push` is not needed * add kgpw for `kubectl get pods --watch` adjust `gm` to make it clearer * remove just.nu --------- Co-authored-by: agent <agent@nuc>
This commit is contained in:
parent
f86a060c10
commit
b6ecfe3680
2 changed files with 24 additions and 14 deletions
|
@ -210,7 +210,7 @@ def "nu-complete kube res via name" [context: string, offset: int] {
|
|||
kubectl get $ns $kind | from ssv -a | get NAME
|
||||
}
|
||||
|
||||
export def "nu-complete kube jsonpath" [context: string] {
|
||||
def "nu-complete kube jsonpath" [context: string] {
|
||||
let ctx = ($context | parse cmd)
|
||||
let kind = ($ctx | get args.1)
|
||||
let res = ($ctx | get args.2)
|
||||
|
@ -257,6 +257,7 @@ export def kg [
|
|||
--selector (-l): string
|
||||
--verbose (-v): bool
|
||||
--watch (-w): bool
|
||||
--wide (-W): bool
|
||||
--all (-A): bool
|
||||
] {
|
||||
let n = if $all {
|
||||
|
@ -269,6 +270,7 @@ export def kg [
|
|||
let r = if ($r | is-empty) { [] } else { [$r] }
|
||||
let l = if ($selector | is-empty) { [] } else { [-l $selector] }
|
||||
if ($jsonpath | is-empty) {
|
||||
let wide = if $wide { [-o wide] } else { [] }
|
||||
if ($verbose) {
|
||||
kubectl get -o json $n $k $r | from json | get items
|
||||
| each {|x|
|
||||
|
@ -283,9 +285,9 @@ export def kg [
|
|||
}
|
||||
}
|
||||
} else if $watch {
|
||||
kubectl get $n $k $r --watch
|
||||
kubectl get $n $k $r $wide --watch
|
||||
} else {
|
||||
kubectl get $n $k $r | from ssv -a
|
||||
kubectl get $n $k $r $wide | from ssv -a
|
||||
}
|
||||
} else {
|
||||
kubectl get $n $k $r $"--output=jsonpath={($jsonpath)}" | from json
|
||||
|
@ -375,7 +377,15 @@ export def kgp [
|
|||
--jsonpath (-p): string@"nu-complete kube jsonpath"
|
||||
--selector (-l): string
|
||||
] {
|
||||
kg pods -n $namespace -p $jsonpath -l $selector $r
|
||||
kg pods -n $namespace -p $jsonpath -l $selector --wide $r
|
||||
}
|
||||
|
||||
export def kgpw [
|
||||
r?: string@"nu-complete kube res via name"
|
||||
--namespace (-n): string@"nu-complete kube ns"
|
||||
--selector (-l): string
|
||||
] {
|
||||
kg pods -n $namespace -w -l $selector --wide $r
|
||||
}
|
||||
|
||||
# kubectl edit pod
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue