Specify how to request an OpenCLI specification from a tool #46
Replies: 2 comments 3 replies
-
|
Seconded. Completion generation (my main use case as a user) has a couple of quasi-standards, but in general it's a mess. Just in the half dozen or so of tools I install with
Of course, OpenCLI would just add another quasi-standard, but I would at least expect to cover all adopting tools by one downstream script. I'd propose to reserve |
Beta Was this translation helpful? Give feedback.
-
|
The Swift Argument Parser project is currently discussing the future of an analogous feature to produce a JSON representation of a tool, called tool info, here: https://forums.swift.org/t/dropping-the-experimental-from-dump-help/82099/5 One suggestion in there is to logically extend the Following this line of reasoning for OpenCLI might yield something like this: |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
OpenCLI can become much more useful as a tool integration if there is a standard way to request from a tool its command structure. For example, a shell autocompletion system might not yet have knowledge of the tool, but if the user invokes it from the system path then it can request the OpenCLI specification from the tool and then provide assistance to the user. In order for workflows like this to work there needs to be a standard method to get the OpenCLI specification from the tool by invoking it.
There is an enormous number of command-line tools and scripts out there, and so the invocation mechanism will need to be unique enough to avoid most collisions with the universe of existing options. Also, the method of invoking the tool to query for an OpenCLI specification will need to be able to cause most tools that do not have OpenCLI specification support to exit with a non-zero exit code. Since there is a possibility of new versions of the specification in the future, this approach should take future versioning into account as well.
One potential approach is to use a globally unique option, specific to OpenCLI, such as
--help-opencli, that is also intuitive to use. Future versions can become their own option--help-opencli<version>to permit tools to over different versions of the specification in the future.Beta Was this translation helpful? Give feedback.
All reactions