Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
halst
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
13 ms
·
31.
▲
Implement a programming language in 55 minutes
(youtube.com)
3 points
by
halst
13y ago
|
0 comments
32.
▲
VI Gang Sign
(github.com)
1 points
by
halst
14y ago
|
0 comments
33.
▲
Schema validation just got Pythonic
(github.com)
3 points
by
halst
14y ago
|
0 comments
34.
▲
The greatest PL talk of all time
(youtube.com)
3 points
by
halst
14y ago
|
1 comments
35.
▲
by
halst
14y ago
About long options repeated: you can either specify "[options]" shortcut in a pattern in order not to put all options in that pattern, or you can have all options listed in the pattern--then you can avoid having them in option description.
36.
▲
by
halst
14y ago
One of the early versions of docopt (0.1) was ported to bash: https://github.com/colinta/bocopsh It should be relatively easy to update it to work with 0.4; if you can make it work with 0.4 it would be great if you make a pull request to
37.
▲
by
halst
14y ago
Quite similar approach. But I think usage-pattern matching is where docopt shines.
38.
▲
by
halst
14y ago
You can just change the second line to: naval_fate ship move <name> <x> <y> [--speed=<kn>] to eliminate all the problems you named. Those problems are about specific interface, not docopt.
39.
▲
by
halst
14y ago
But I must warn you: Ruby port (as of now) implements only a small subset of docopt language, but we're working on it.
40.
▲
by
halst
14y ago
Thanks a lot for the link. Your suggestion will probably make into next version of docopt.
41.
▲
by
halst
14y ago
Getopt::Euclid from CPAN is also very similar.
42.
▲
by
halst
14y ago
docopt will maybe borrow a few ideas from dreamopts.js :-) Would you like to join forces on [docopt.coffee]( https://github.com/docopt/docopt.coffee )?
43.
▲
by
halst
14y ago
When the DSL ( http://docopt.org/ ) was designed, the main goal was just to formalise that pattern-language used for decades in man pages and `--help` screens. So variations that are conventional (such as `UPPER-CASE` for arguments or `&
44.
▲
by
halst
14y ago
I think Clap is good . But you can't beat the readability and succinctness of a DSL (docopt).
45.
▲
by
halst
14y ago
Right now we have two full-blown working implementations: - Python - CoffeeScript We have just started to port to Ruby and Lua. All ports live under `docopt` organization on GitHub: https://github.com/docopt You are very welcome to hel
46.
▲
by
halst
14y ago
I'm also a fan of idea of using function-docstrings for separate subcommand help-screens. Problems: (1) exact API, (2) how to do that in non-python implementations. You (and everyone) is very welcome to suggest APIs for that in issues:
47.
▲
by
halst
14y ago
BTW, about bad pitch: maybe :-) I wanted to improve on presentation, since my last post: http://news.ycombinator.com/submitted?id=halst
48.
▲
by
halst
14y ago
docopt is even more terse than 1 line per argument/option/command. Take an example: Usage: quick_example.py tcp <host> <port> [--timeout=<seconds>] quick_example.py serial <port> [--baud=9600
49.
▲
by
halst
14y ago
You can already have deeply nested subcommands in docopt, take this example: https://github.com/docopt/docopt/blob/master/examples/git_ex... Making possible several help-screens for different commands is on it's way. The only stopper—deci
50.
▲
by
halst
14y ago
That exactly what [docopt]( http://docopt.org/ ) is—DSL that allows implement almost any interface in one line (having formal interface description).
51.
▲
Challenge: Implement CLI interface like that?
(challenge.docopt.org)
74 points
by
halst
14y ago
|
46 comments
52.
▲
by
halst
14y ago
I know a tiny bit of Lua. Write me halst@ya.ru or skype "halst." we can discuss your Lua port.
53.
▲
by
halst
14y ago
It should be easy to port it - docopt is only 366 LOC itself.
54.
▲
by
halst
14y ago
wow, great! what is your scripting language?
55.
▲
Docopt creates beautiful command-line interfaces
(docopt.org)
7 points
by
halst
14y ago
|
7 comments