elvish_config/lib/moi/completion/desarchiver.elv

13 lines
309 B
Plaintext
Raw Normal View History

2020-03-13 14:03:36 +00:00
use moi/util/condition
use moi/util/file
2021-08-27 20:06:49 +00:00
var extensions = [ tar bz2 zip gz lz4 sz xz zst rar ]
2020-03-13 14:03:36 +00:00
fn complete [@argv]{
2021-08-27 20:06:49 +00:00
var m = $argv[-1]
var type = (condition:cset (eq $m '') prefix deep-prefix)
2020-03-13 14:03:36 +00:00
file:match-extensions &type=$type $m $@extensions
}
edit:completion:arg-completer[desarchiver] = $complete~