An Elvish module for importing Bash completion scripts.
Specifically, the module is designed for use with the bash-completion
package, a set of completion scripts common across many
operating systems. It is similar to the elvish-bash-completion
module, with two major differences.
- It provides an
autoimportcommand to import as many completions as possible, rather than requiring the user to specifically import the ones they're interested in in theirrc.elv. - It uses the system's copy of
bash-completionsrather than bundling its own. This is desirable if you want to be sure that you're using completion code that's been vetted by your operating system's package maintainers or corporate I.T. team, for example. (complete-from-bashis intended to be short and easy to audit yourself, if you care about that kind of thing.)
Install the package via epm:
epm:install github.com/HarryCutts/elvish-complete-from-bashRun the autoimport function in your rc.elv to import Bash completions for all commands in your
$paths that don't already have a completion function assigned, assuming that one's available in
Bash:
# Import all your native Elvish completers...
set edit:completion:arg-completer[foo] = $my-foo-completer~
use some/other/completion/module
# ...then auto-import everything else from Bash
use github.com/HarryCutts/elvish-complete-from-bash/complete-from-bash
complete-from-bash:autoimportAlternatively, you can import a specific completer using import-for:
use github.com/HarryCutts/elvish-complete-from-bash/complete-from-bash
complete-from-bash:import-for apt