Require = for --tmpdir in mktemp#4342
Conversation
|
Cool! Did you see #4275 already? Is this an improvement over that PR? |
|
I didn't see that other PR. I'm doing a review of it now. Overall, it looks pretty similar. |
|
I commented the same on the other PR, but I like the approach here a bit better, as long it passes the same tests. So you could copy the tests from that PR (maybe with a co-author credit to @dmatos2012 in the commit). |
b3e358e to
a02348e
Compare
|
GNU testsuite comparison: |
|
Hey @tmccombs @tertsdiepraam , yes I also think this PR is slightly cleaner with the So good job, looking nice :) |
c340431 to
5423deb
Compare
|
I just see that you've also opened an issue at clap. If they want this functionality that's fine, but I don't think we need to push for this feature and complicate clap unnecessarily. For context, I've been working on a custom argument parser for uutils (see #4254). This is what |
5423deb to
edbdfea
Compare
|
Looks good! From my perspective, all that's missing is a co-author credit for @dmatos2012 in the test commit. |
82d26c7 to
f45feb7
Compare
|
Fails on Windows: |
sylvestre
left a comment
There was a problem hiding this comment.
could you please fix the conflict? thanks
6dc2993 to
438f1b4
Compare
|
GNU testsuite comparison: |
|
I'm trying to fix the test on windows to get this merged finally :) |
c25a730 to
34c10e0
Compare
|
GNU testsuite comparison: |
Fixes uutils#3454 This implementation more closely matches the behavior of GNU mktemp. Specifically, if using the short-form `-p`, then DIR is required, and if using the long form `--tmpdir` then DIR is optional, but if provided, must use the `--tmpdir=DIR` form (not `--tempdir DIR`), so that there is no ambiguity with also passing a TEMPLATE. The downside to this implementation is we are now introducing a new workaround for clap-rs/clap#4702 where we use separate calls to `.arg()` for the short `-p` and the long `--tmpdir`, which results in a less than ideal output for `--help`.
And set overrides_with for tmpdir flags. Tests were copied from uutils#4275 Co-authored-by: David Matos <davidmatos06@gmail.com>
34c10e0 to
964b1d6
Compare
|
well done! |
Fixes #3454
This implementation more closely matches the behavior of GNU mktemp. Specifically, if using the short-form
-p, then DIR is required, and if using the long form--tmpdirthen DIR is optional, but if provided, must use the--tmpdir=DIRform (not--tempdir DIR), so that there is no ambiguity with also passing a TEMPLATE.The downside to this implementation is we are now introducing a new workaround for clap-rs/clap#4702 where we use separate calls to
.arg()for the short-pand the long--tmpdir, which results in a less than ideal output for--help.