3 ms·
One interesting thing to note is that IEEE 1003 says: "The -W (capital-W) option shall be reserved for vendor options." GNU getopt() uses this to make --foo an
by dfox 8y ago
One interesting thing to note is that IEEE 1003 says: "The -W (capital-W) option shall be reserved for vendor options."
GNU getopt() uses this to make --foo and -Wfoo equivalent, but this is GNUism of questionable utility.
I have feeling that original reason for this is that there historically was libc which implemented wordexp(3) by exec'ing /bin/sh -W, but I have no way to confirm that.
- cyphar 8y agoI can imagine one of the reasons it might be useful is if you have a badly written argument parser that only accepts single-dash commands, but you need to pass a long argument (that gets shelled out). However, it's entirely opt-in so I imagine this is not practically useful for most programs. Notably, GCC's -W<foo> works the same way. You could do "gcc --all" if you wanted to.