Skip to content

Commit ca39ece

Browse files
committed
jc: only show --options if commandline ends with -
1 parent 2b2a17d commit ca39ece

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

modules/jc/mod.nu

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
def --env "nu-complete jc" [] {
1+
def --env "nu-complete jc" [commandline: string] {
22
try {
33
let about = ^jc --about
44
| from json
@@ -30,7 +30,12 @@ def --env "nu-complete jc" [] {
3030
}
3131
| flatten
3232

33-
$options ++ $inherent ++ $magic
33+
$magic
34+
++ if ($commandline | str ends-with "-") {
35+
$options ++ $inherent
36+
} else {
37+
[]
38+
}
3439
} catch {
3540
[]
3641
}

0 commit comments

Comments
 (0)