Closed goofinator closed 4 years ago
Yes, BSD and POSIX implementations often allow for this, however I feel this makes it hard to read/understand for newcomers. Also the logic for parsing becomes very complex because of:
While answer to those may seem obvious to any experienced tar
user (for example), I feel that implementing this, and documenting brings new level of complexity that I would like to avoid.
The goal of this library is to be as explicit about all options as possible and even combining shorthand arguments is already a little bit too much.
The standard approach is a one shortened argument with a parameter that closes the sequence of flags. And I think that it is not so difficult to implement (I would take it). It seems to me that for the UNIX CLI users this is the expected behavior. And in my programs I would prefer to provide it. What if you let the programmer to enable this behavior by configuration function call, or something like that. Then the default behavior of the library will correspond to your vision, but it will be more democratic to the developer of the final application? Of course, I respect the opinion of the author, so the final decision is yours.
I’m okay if that could be implemented with minimal changes and not affecting functionality of other methods.
Hello! Interesting: how critical is the design requirement: "Shorthand arguments ONLY for parser.Flag () can be combined into single argument same as ps -aux or rm -rf" It seems to me that it would be a good idea to give the opportunity to combine a shorthand arguments with a parameter with flags if it is written after them. I mean some thing like this: tar -cvaf foo.tar.gz foo