Skip to content

Instantly share code, notes, and snippets.

@NV
Created December 18, 2011 21:40
Show Gist options
  • Save NV/1494553 to your computer and use it in GitHub Desktop.
Save NV/1494553 to your computer and use it in GitHub Desktop.
Trying to make coa (https://github.com/veged/coa) shell command auto-completion work.
  1. I've made a coa-completion-dummy
  2. ➤ ./coa-completion-dummy --ve
  3. Press Tab and nothing happens

I guess I have to generate some shell script first and then put source some_script.sh in my .bashrc. README.md doesn't mention any of those, instead it says:

Cmd.completable Adds shell completion to command, adds "completion" subcommand, that makes all the magic.

#!/usr/bin/env node
require('coa').Cmd()
.completable()
.opt()
.name('version')
.short('v')
.long('version')
.flag()
.act(function(opts) {
return 42;
})
.end()
.run(process.argv.slice(2));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment