Skip to content

Commit 0a36da8

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

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

modules/jc/mod.nu

Lines changed: 6 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,11 @@ def --env "nu-complete jc" [] {
3030
}
3131
| flatten
3232

33-
$options ++ $inherent ++ $magic
33+
$magic ++ if ($commandline | str ends-with "-") {
34+
$options ++ $inherent
35+
} else {
36+
[]
37+
}
3438
} catch {
3539
[]
3640
}

0 commit comments

Comments
 (0)