3 ms·
> Quoting on Linux is consistent. Out of curiosity, what do you use to do this? Gnu getopt and genopt are brilliant in my experience and handle all of the edge
by azalemeth 5y ago
> Quoting on Linux is consistent.
Out of curiosity, what do you use to do this? Gnu getopt and genopt are brilliant in my experience and handle all of the edge cases really well. The fact that they are consistent just means that it works, as long as you don't hit the stack limit.
- iforgotpassword 5y agoI mean, from the apps perspective, everything has already been either parsed properly by the shell, or passed directly as intended in an array by another program. From the user's perspective, the shell does it the same for every program you invoke. Not all shells have exactly the same quoting rules necessarily, but it's the component that's deciding how to do it. If you're in doubt you can even ask it to print how it parses the command line you're currently writing. On Windows I can compile the same C program with two different compilers and get two different comment line parsing behaviors, which I'd say, is much less obvious to the user.