Skip to content
This repository has been archived by the owner on Feb 16, 2023. It is now read-only.

Add --force flag to inject command #261

Open
SimonBarendse opened this issue Mar 18, 2020 · 5 comments
Open

Add --force flag to inject command #261

SimonBarendse opened this issue Mar 18, 2020 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@SimonBarendse
Copy link
Member

-f, --force (bool)
  When injecting to an output file and the file already exists, overwrite it.
@SimonBarendse SimonBarendse added the enhancement New feature or request label Mar 18, 2020
@mackenbach
Copy link
Member

Sweet! Should this also be included in the read command, which has an --output-file flag?

And, it's kinda implied, but it may be good to speficy that the --force flag is ignored if --output-file isn't specified?

@mackenbach
Copy link
Member

And thanks for the suggestion @antonbabenko

@SimonBarendse
Copy link
Member Author

Sweet! Should this also be included in the read command, which has an --output-file flag?

The read command always overwrites the file. I'm hesitant to change that, as it might break existing workflows if we now require --force to do so.

And, it's kinda implied, but it may be good to speficy that the --force flag is ignored if --output-file isn't specified?

Yes good idea. Can't be too explicit 👍

@mackenbach
Copy link
Member

The read command always overwrites the file. I'm hesitant to change that, as it might break existing workflows if we now require --force to do so.

After thinking twice about what you said, do we actually want that, and why? Yes, changing it would be breaking, but I'd like us to be conscious as to why we have this behavior.

And the docs currently don't mention that it always overwrites, so maybe it's good to add that there too to be explicit.

-o, --out-file=OUT-FILE  Write the secret value to this file.

@SimonBarendse
Copy link
Member Author

Ideally, the read command should behave similar to the inject command. Also, I think passing a flag to explicitly overwrite the file is better.

I can see the following migration path:

Add --force flag to read to overwrite the file, also, still overwrite if the flag is not supplied as well, but deprecate that. Then, a few versions later, remove support for overwriting the file without passing the --force flag.

This way, we give users that depend on the read command to overwrite the file some time to migrate.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants