diff --git a/modules/docker/mod.nu b/modules/docker/mod.nu index c7081dc6..2c5cf302 100644 --- a/modules/docker/mod.nu +++ b/modules/docker/mod.nu @@ -290,7 +290,7 @@ export def --wrapped container-attach [ } def "nu-complete docker cp" [cmd: string, offset: int] { - let argv = $cmd | str substring ..$offset | split row ' ' + let argv = $cmd | str substring ..<$offset | split row ' ' let p = if ($argv | length) > 2 { $argv | get 2 } else { $argv | get 1 } let container = ^$env.docker-cli ps | from ssv -a diff --git a/modules/kubernetes/complete.nu b/modules/kubernetes/complete.nu index 0557dfb5..e7851255 100644 --- a/modules/kubernetes/complete.nu +++ b/modules/kubernetes/complete.nu @@ -150,7 +150,7 @@ export def "nu-complete kube port" [context: string, offset: int] { } export def "nu-complete kube cp" [cmd: string, offset: int] { - let ctx = $cmd | str substring ..$offset | argx parse + let ctx = $cmd | str substring ..<$offset | argx parse let p = $ctx._args | get (($ctx._args | length) - 1) let ns = $ctx.namespace? | with-flag -n let c = $ctx.container? | with-flag -c diff --git a/modules/kubernetes/helm.nu b/modules/kubernetes/helm.nu index 56563e08..a3cd486b 100644 --- a/modules/kubernetes/helm.nu +++ b/modules/kubernetes/helm.nu @@ -36,7 +36,7 @@ export def kgh [ | from json | update updated {|x| $x.updated - | str substring ..-4 + | str substring ..<-4 | into datetime -f '%Y-%m-%d %H:%M:%S.%f %z' } } else { diff --git a/modules/kubernetes/mod.nu b/modules/kubernetes/mod.nu index fa3785ea..c3a29f59 100644 --- a/modules/kubernetes/mod.nu +++ b/modules/kubernetes/mod.nu @@ -266,7 +266,7 @@ export def --wrapped ka [ let n = $namespace | with-flag -n let pod = if ($selector | is-empty) { if ($pod | str ends-with '-') { - $"deployment/($pod | str substring ..-1)" + $"deployment/($pod | str substring ..<-1)" } else { $pod } @@ -314,7 +314,7 @@ export def kl [ let f = if $follow {[-f]} else {[]} let p = if $previous {[-p]} else {[]} let trg = if ($pod | str ends-with '-') { - $"deployment/($pod | str substring ..-1)" + $"deployment/($pod | str substring ..<-1)" } else { $pod } @@ -513,8 +513,8 @@ export def ktp [ { namespace: $x.namespace name: $x.name - cpu: ($x.cpu| str substring ..-1 | into float) - mem: ($x.mem | str substring ..-2 | into float) + cpu: ($x.cpu| str substring ..<-1 | into float) + mem: ($x.mem | str substring ..<-2 | into float) } } } else { @@ -523,8 +523,8 @@ export def ktp [ | each {|x| { name: $x.name - cpu: ($x.cpu| str substring ..-1 | into float) - mem: ($x.mem | str substring ..-2 | into float) + cpu: ($x.cpu| str substring ..<-1 | into float) + mem: ($x.mem | str substring ..<-2 | into float) } } } @@ -535,10 +535,10 @@ export def ktno [] { kubectl top node | from ssv -a | rename name cpu pcpu mem pmem | each {|x| { name: $x.name - cpu: ($x.cpu| str substring ..-1 | into float) - cpu%: (($x.pcpu| str substring ..-1 | into float) / 100) - mem: ($x.mem | str substring ..-2 | into float) - mem%: (($x.pmem | str substring ..-1 | into float) / 100) + cpu: ($x.cpu| str substring ..<-1 | into float) + cpu%: (($x.pcpu| str substring ..<-1 | into float) / 100) + mem: ($x.mem | str substring ..<-2 | into float) + mem%: (($x.pmem | str substring ..<-1 | into float) / 100) } } } diff --git a/modules/ssh/scp.nu b/modules/ssh/scp.nu index a3ed7f5f..d3f48f74 100644 --- a/modules/ssh/scp.nu +++ b/modules/ssh/scp.nu @@ -1,5 +1,5 @@ def "nu-complete scp" [cmd: string, offset: int] { - let argv = ($cmd | str substring ..$offset | split row ' ') + let argv = ($cmd | str substring ..<$offset | split row ' ') let p = if ($argv | length) > 2 { $argv | get 2 } else { $argv | get 1 } let ssh = (ssh-hosts | get completion | each {|x| {value: $"($x.value):" description: $x.uri} }