mirror of
https://github.com/RGBCube/nu_scripts
synced 2025-07-31 14:17:45 +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 {
|
||||
let about = ^jc --about
|
||||
| from json
|
||||
|
@ -30,7 +30,11 @@ def --env "nu-complete jc" [] {
|
|||
}
|
||||
| flatten
|
||||
|
||||
$options ++ $inherent ++ $magic
|
||||
$magic ++ if ($commandline | str ends-with "-") {
|
||||
$options ++ $inherent
|
||||
} else {
|
||||
[]
|
||||
}
|
||||
} catch {
|
||||
[]
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue