elvish_config/lib/moi/completion/kcp.elv

42 lines
399 B
Plaintext
Raw Normal View History

2020-03-13 14:03:36 +00:00
fn -remotes-packages { kcp -lN }
options = [
-h
-v
-i
-di
-u
-l
-lN
-lS
-lI
-lO
-lx
-lxS
-lxI
-lxO
-lf
-s
-g
-V
]
np = [
-i
-di
-s
-g
-V
]
fn complete [@argv]{
local:c = (count $argv)
if (== $c 2) {
2020-07-22 09:24:43 +00:00
all $options
2020-03-13 14:03:36 +00:00
} elif (and (== $c 3) (has-value $np $argv[-2])) {
-remotes-packages
}
}
edit:completion:arg-completer[kcp] = $complete~