elvish_config/lib/moi/completion/kcp.elv

42 lines
409 B
Plaintext
Raw Normal View History

2020-03-13 14:03:36 +00:00
fn -remotes-packages { kcp -lN }
2021-08-27 20:06:49 +00:00
var options = [
2020-03-13 14:03:36 +00:00
-h
-v
-i
-di
-u
-l
-lN
-lS
-lI
-lO
-lx
-lxS
-lxI
-lxO
-lf
-s
-g
-V
]
2021-08-27 20:06:49 +00:00
var np = [
2020-03-13 14:03:36 +00:00
-i
-di
-s
-g
-V
]
2021-12-11 21:09:02 +00:00
fn complete {|@argv|
2021-08-27 20:06:49 +00:00
var c = (count $argv)
2020-03-13 14:03:36 +00:00
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
}
}
2021-10-13 18:49:48 +00:00
set edit:completion:arg-completer[kcp] = $complete~