secrethub-cli
secrethub-cli copied to clipboard
Add `--force` flag to inject command
-f, --force (bool)
When injecting to an output file and the file already exists, overwrite it.
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?
And thanks for the suggestion @antonbabenko
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 :+1:
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.
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.