coreutils
coreutils copied to clipboard
mktemp: Fix behavior of short-long options of tmpdir
Hi, This PR started addressing issue #4175, which it fixed but I tried to go a bit further when tinkering with the ways tmpdir option is given.
Previously using something such as mktemp -p <path> --tmpdir <path2> would error out since from claps perspective its a single option used twice. However, this is very much allowed in GNU. Therefore, I managed to include that behavior by adding a second short flag -p and use independent of --tmpdir, as suggested by @tertsdiepraam.
I also managed to remove some of the previous workarounds to solve some other issues, but of course introduced some new workarounds.
One last note, is that this introduces a bit of undesired empty line (see after -p <DIR>) in the help message due to the new argument, that I am not sure how to fix, so if anyone knows how to, please feel free to help :D
uu_mktemp --help yields now
.....
-p <DIR>
--tmpdir[=<DIR>] interpret TEMPLATE relative to DIR.....
....
instead of the way before
-p , --tmpdir [<DIR>] interpret TEMPLATE relative to DIR......
Cool! I think we "fixed" the empty line is other utils by just adding a help string for -p. Something like "Same as `--tmpdir`"
Yeah good idea, i have added that , should be ready :)
@dmatos2012 ping?
@sylvestre as far as I was concerned, these changes were going to be merged from PR #4342 . @tertsdiepraam mentioned the approach there was better and copy the tests from here, so I assumed there was nothing to be done from me here :). Check that PR for details
Closing this PR as it is replaced by #4342. Thanks anyway for your PR :)