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

jc: only show --options if commandline ends with -

This commit is contained in:
RGBCube 2025-07-19 00:06:31 +03:00
parent 2b2a17d54b
commit 0a36da8326
Signed by: RGBCube
SSH key fingerprint: SHA256:CzqbPcfwt+GxFYNnFVCqoN5Itn4YFrshg1TrnACpA5M

View file

@ -1,4 +1,4 @@
def --env "nu-complete jc" [] { def --env "nu-complete jc" [commandline: string] {
try { try {
let about = ^jc --about let about = ^jc --about
| from json | from json
@ -30,7 +30,11 @@ def --env "nu-complete jc" [] {
} }
| flatten | flatten
$options ++ $inherent ++ $magic $magic ++ if ($commandline | str ends-with "-") {
$options ++ $inherent
} else {
[]
}
} catch { } catch {
[] []
} }