elvish_config/lib/moi/completion/desarchiver.elv

13 lines
313 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
2021-12-11 21:09:02 +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
}
2021-10-13 18:49:48 +00:00
set edit:completion:arg-completer[desarchiver] = $complete~