Usage Specification
16 points by pushcx
16 points by pushcx
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.
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?
That doesn't seem realistic to be honest. I mean, there's an infinite scope of ontology you don't care about or for valid reasons have a different idea about. Even the idea of defining a connection endpoint is dramatically different between mssql connection string and mysql. And that's before you touch on real life entities that are partially defined by laws changing every few months. We don't even have a consistent way to parse an address globally. And then there's the issue of "agreeing" which is hard on its own to do in a timely manner.
The idea of RDF and semantic web was popular at some point which is related, but it pretty much died. (As a general purpose thing. There are specialist applications that actually use it)
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?
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