TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Command-line interface description language

133 pointsby primrootalmost 11 years ago

11 comments

mtdewcmualmost 11 years ago
What would make this killer is if it automatically generated a top-notch bash completion script, like the kind that exists for git. There are very few that exploit the full potential. In fact, without that feature, this seems like overkill for a CLI. A CLI is already the simplest kind of interface, and it usually takes years for a tool to acquire that many features.
jnbichealmost 11 years ago
Oh nice, a golang opt parser that doesn't flout age-old Unix traditions.
评论 #7831385 未加载
评论 #7835549 未加载
kolevalmost 11 years ago
Although it seems like a great tool (and it is), when you start using docopt, it becomes tedious to check for complex command subcommand cases, for example, especially when you have lots of them, and you then switch to Click, JCommander, or the likes.
评论 #7833540 未加载
rbonvallalmost 11 years ago
It would be a nice convention if CLI applications shipped a USAGE.txt or OPTIONS.txt file written in docopt in the root of their repo, along other standard files that one expects to be there like README.txt, requirements.txt, setup.py, project.json, etc.<p>That way it would be easier to write utilities for testing the CLI, to generate the shell completion script and to change the interface without messing with hard-coded strings in the code.
评论 #7837563 未加载
X4almost 11 years ago
I remember there was <a href="http://click.pocoo.org/" rel="nofollow">http:&#x2F;&#x2F;click.pocoo.org&#x2F;</a> once on the front-page too.
评论 #7831074 未加载
busteralmost 11 years ago
After using docopt for a while you&#x27;re realize you don&#x27;t want to google and trial&amp;error text strings somewhere in the file and eventually switch to argtools to realize how easy it can really be ;)
TuxLynalmost 11 years ago
This is how simple all code should be :-) Good Job!
dTalalmost 11 years ago
Hm! I once looked at auto-generating GUI wrappers for command line programs from their manpage syntax, but it turned out that manpage syntax, while it <i>looks</i> standardised to a human, isn&#x27;t. This would open a lot of really exciting possibilities if it were more widely used.
tlrobinsonalmost 11 years ago
So elegant and obvious in retrospect. More stuff like this, please!
nialv7almost 11 years ago
I think it&#x27;d be better if the CLI is described in a simpler and machine readable language, and then generate usage text and parser from that.
评论 #7837586 未加载
ams6110almost 11 years ago
docopt is cool, but is there something new here? It&#x27;s been around for a while.
评论 #7831313 未加载
评论 #7832180 未加载
评论 #7832635 未加载