Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mktemp: simplify file path parameter logic #3573

Merged
merged 1 commit into from
Jun 1, 2022

Conversation

jfinkels
Copy link
Collaborator

Simplify the logic of computing the file path parameters (the
directory, prefix, suffix, and number of random characters) for the
temporary file created by mktemp. This commits adds an Options
struct as a layer of indirection between the application logic and
clap, and a Params struct whose associated function is responsible
for determining the file path parameters from the Options. This is
an improvement because the previous code had some logic for
determining file path parameters in one place and some in another
place.

This change will help me finish the work started in pull request #3568.

@jfinkels jfinkels force-pushed the mktemp-simpler-prefix-suffix branch from e3b6348 to f4fd705 Compare May 29, 2022 00:27
Simplify the logic of computing the file path parameters (the
directory, prefix, suffix, and number of random characters) for the
temporary file created by `mktemp`. This commits adds an `Options`
struct as a layer of indirection between the application logic and
`clap`, and a `Params` struct whose associated function is responsible
for determining the file path parameters from the `Options`. This is
an improvement because the previous code had some logic for
determining file path parameters in one place and some in another
place.
@jfinkels jfinkels force-pushed the mktemp-simpler-prefix-suffix branch from f4fd705 to 43e9fb7 Compare May 31, 2022 23:35
@sylvestre
Copy link
Sponsor Contributor

better indeed :)

@sylvestre sylvestre merged commit 2ed64fc into uutils:main Jun 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants