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:
parent
2b2a17d54b
commit
0a36da8326
1 changed files with 6 additions and 2 deletions
|
@ -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 {
|
||||||
[]
|
[]
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue