Comment by EE84M3i
6 years 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.
http://docopt.org/
I 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
There 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.
Yea, like, imagine if posix pipes and command-line flags could be typed.
The 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.
Powershell offers this I believe.
NuShell is also attempting this. Both are cross platform.
https://github.com/nushell/nushell
1 reply →
That's right. I recently wrote on this topic: https://jmmv.dev/2020/10/powershell-cmdlet-params.html
Yep. 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.
it's not that we don't have standard(s); it's the problem of adoption.