Usage Specification

16 points by pushcx


hoistbypetard

This made me think of docopt when I first looked, but it really seems more like the reverse now that I look closer at it.

I think this is probably the better direction to go, as docopt was good at first but seemed very fiddly after using it for a while. I'll definitely be keeping my eyes open for the planned typer integration, as I've been dragging my feet on generating shell completion files for a couple of internal gadgets, but they'd be nice to have. Generating them based on typer would feel like magic.

smlckz

This reminds me of Swift configuration. Is there any effort to port it to other languages or make it into a standard like this?

Also, I wonder if standardization of logging or even application state would be a meaningful thing to do.. like for every kind of application, they have their own bespoke file format for storing the application state, that gets used when porting to another application (e.g. OPML among feed readers, .vcf for contact information, etc.), not into a specific format (like JSON or SQLite), but agreeing on the vocabulary and ontology, so that regardless of the format people come up with in future, the information can be passed down with little loss?

trousers

Seems nice (big fan of kdl).

Are there any libraries that support using the spec to define the cli interface, to replace things like Cobra(go), and not just convert a Cobra command tree into usage output?

mdaniel

Usage specs are written in kdl which is a newer document language that sort of combines the best of XML and JSON

I struggle to think how someone would chose to make a new document language, versus the 10,000 that already exist, but then also to try and marry those two mental models

As if to double down on my comment, the syntax highlighting on their webpage is almost illegible, which wouldn't have been a problem had they chosen something that codemirror already knows about