Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Generate command-line completions using a simple DSL (github.com/mbrubeck)
40 points by dmmalam on Sept 4, 2015 | hide | past | favorite | 5 comments


Sweet! Similar to docopt. It's humbling to see how short this can be in Haskell, compared to my C++ code https://github.com/ridiculousfish/docopt_fish (though in my defense the C++ version is more featureful, with better error messages).

We're likely to build this sort of thing in directly to the fish shell: https://github.com/fish-shell/fish-shell/issues/478 . From a usage spec, you get tab-completions, syntax highlighting, argument parsing and validation, and user help.

It's sort of silly that there is no machine-parseable usage spec for common Unix commands. Once the docopt support is integrated, I hope to create a repository of usage specs that anyone can contribute to, similar to explainshell.com


> It's sort of silly that there is no machine-parseable usage spec for common Unix commands

man pages can qualify for a usage spec. Projects like explainshell.com[1] parse these quite successfully.

[1]http://explainshell.com


I prefer to read the options directly from the commands and feed them into the auto completions, some examples: https://github.com/chilicuil/learn/tree/master/autocp/comple...


This has come at a good time. I've been using git, composer and Laravel's artisan thinking that this sort of thing would improve my productivity massively.

File name completions are great but option/sub-command completions could really speed up my workflow.


Nice to see tools make tasks easier, but I do not like the trend of using every other new (I know Haskell is not new) language for it. I don't need the large download and compile time for a simple tool.

But great work!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: