Skip to content

Instantly share code, notes, and snippets.

@dbb
Created August 4, 2015 21:13
Show Gist options
  • Save dbb/455a196da7ee030ab08e to your computer and use it in GitHub Desktop.
Save dbb/455a196da7ee030ab08e to your computer and use it in GitHub Desktop.
Example opts file for the fictional `mycmd`

Some kind of generic data structure that would be relatively easy to write AND parse, like YAML or ConfigFile-ish.

name:       mycmd

shortops
  a:        [short name, description]
  h:        [help, display help text]
  v:        [version, display version text]
longopts
  help:     [help, display help text]
  version:  [version, display version text]

Then when mycmd -<TAB> is entered, the short ops are displayed (ideally tabulated into a readable layout first), and so on.

I'm guessing the reason nothing like this exists is because shell creators have different ideas of how a completion file's syntax should be. But I wish something like this DID exist because writing even simple zsh comp files is a nightmare. I think the manpage is like 10,000 or so lines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment