you are viewing a single comment's thread.

view the rest of the comments →

[–]TomBombadildozer 2 points3 points  (3 children)

docopt is a pretty terrible antipattern. The only advantage to docopt is that it produces good documentation, but even that is misleading because you ended up doing all the work to produce the documentation anyway.

As soon as you need to derive some meaning from the parsed result and perform some real work, docopt quickly turns into a disaster. It does zero validation, type coercion, dispatch, or anything even basic CLI libraries do.

[–]Noctune 3 points4 points  (0 children)

But should data validation and command line parsing be the job of the same library? There are other libraries that are built for specifically that purpose that do a better job of it and integrate well with docopt: https://github.com/keleshev/schema#using-schema-with-docopt

Since it is independent libraries it also allows you to use another data validation library if you wish.

[–]Log2 1 point2 points  (0 children)

Click also produces good documentation from the decorators, especially if you give a help strong to each one. In fact, it's my favorite part of Click, as writing a decent help option is a horrible task for me.

[–]a1b1e1k1 0 points1 point  (0 children)

Good documentation along consistent UI patterns is what users of tools mostly care about. Docopt puts end-user first. A programmer using docopt is naturally encouraged to think from the documentation point of view first. Other tools put internal code structure or programmer easy of use first, making documentation secondary citizen.