coreutils icon indicating copy to clipboard operation
coreutils copied to clipboard

mktemp: replace workaround code with features of clap 3

Open jfinkels opened this issue 2 years ago • 1 comments

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?

jfinkels avatar Apr 29 '22 01:04 jfinkels

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.

djhworld avatar May 04 '22 21:05 djhworld