5 ms·
It's kind of crazy that we still don't have a standard computer readable way for a program to describe it's argument structure in a computer readable way that c
by EE84M3i 6y ago
It's kind of crazy that we still don't have a standard computer readable way for a program to describe it's argument structure in a computer readable way that could be used for command line autocomplete. E.g. something like an extra section in the binary that describes how arguments are processed.
- mmalone 6y agoYea, like, imagine if posix pipes and command-line flags could be typed.
- vageli 6y agoPowershell offers this I believe.
- mmalone 6y agoYep. Not perfect... type systems have come a long way since PowerShell did it. But it's a good start. Look at stuff like PowerShell secure strings for an example of the sort of neat stuff you can do.
- ChrisSD 6y agoNuShell is also attempting this. Both are cross platform. https://github.com/nushell/nushell https://github.com/nushell/nushell
- _underfl0w_ 6y agoThanks for mentioning this! It looks super interesting, but I hadn't heard of it before.
- jmmv 6y agoThat's right. I recently wrote on this topic: https://jmmv.dev/2020/10/powershell-cmdlet-params.html https://jmmv.dev/2020/10/powershell-cmdlet-params.html
- delusional 6y agoThe general problem is that typing for these sorts of systems suck. If it works it's a nice little safety feature, but when the types don't line up it's infuriating. Treating everything as a lowest common denominator makes compatibility trivial.
- d0mine 6y agohttp://docopt.org/ http://docopt.org/
- sgao08 6y agoit's not that we don't have standard(s); it's the problem of adoption.
- rmetzler 6y agoI think it would be probably easier to have a convention of programs to output their autocompletion options similar to how github.com/urfave/cli does. https://github.com/urfave/cli/tree/master/autocomplete https://github.com/urfave/cli/tree/master/autocomplete
- EE84M3i 6y agoThere still needs to be some out of hand signal that it accepts that option otherwise you would pass it to tools that don't and cause undefined behavior.