coreutils
coreutils copied to clipboard
mktemp: replace workaround code with features of clap 3
This code has a comment describing a workaround for a missing feature in clap that was not available until clap 3: https://github.com/uutils/coreutils/blob/bf3a86f654b5982b124dd385782ee8feea10abbd/src/uu/mktemp/src/mktemp.rs#L89-L98 Perhaps some code here can be simplified now that clap 3 is available?
I'm not sure if the linked issue in clap 3 fixes the problem.
The issue stems from the fact that --tmpdir
will never be empty if a template is passed (e.g. mktemp --tmpdir apt-key-gpghome.XXX
)
clap will interpret the value of --tmpdir
to be apt-key-gpghome.XXX
rather than ""
hence why this workaround is in place.
Adding default_missing_value
doesn't fix it because --tmpdir
is always going to be populated when a 'template' is passed.