-
Notifications
You must be signed in to change notification settings - Fork 54
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add output to tedge cert create
and tedge cert remove
commands
#1654
Conversation
30c1bf9
to
e75ea51
Compare
Thanks for the PR, yes this is great. It was actually on the roadmap. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only some minor things. This small improvement has a great user impact!
I personally prefer terse tools. That said the design of the user interface is not my domain of responsibility and I will let @reubenmiller decide. The key point is to have a consistent CLI! |
Yes I would prefer having giving the user feedback as it helps gain user trust by showing them that something was done. But yes I agree that running |
Added output to `tedge cert create` and `tedge cert remove` commands: - `tedge cert create` - `Certificate was successfully created.` if certificate was successfully created - `tedge cert remove` - `Certificate was successfully removed.` if certificate was removed - `There is no certificate to remove.` if there is no certificate The documentation was also updated to include the added output. The change was made because I think it would be good for all the CLI commands that could possibly be invoked by the human, to print human-readable output describing what happened, even if just one sentence, it's better than nothing. E.g. `tedge cert remove` returned `Ok` for both `cert removed` and `no cert` cases, but it had no output, so the user wouldn't know what actually happened. Alternatively `no cert` case could return an error, but I'd argue it makes more sense as a success case because the end result is the same as with `cert removed` case: there is no cert and a new one can be created. As for the implementation, i separated the logic and printing between 2 impls, but e.g. `cli/certificate/show.rs` just does the printing in the 2nd impl, and if it's fine, then I could also move the print there and avoid some boilerplate. Lastly, sorry if I'm bikeshedding too hard 馃槄 Signed-off-by: Marcel Guzik <marcel.guzik@inetum.com>
2937a23
to
775078b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved
Proposed changes
Added output to
tedge cert create
andtedge cert remove
commands:tedge cert create
Certificate was successfully created.
if certificate was successfully createdtedge cert remove
Certificate was successfully removed.
if certificate was removedThere is no certificate to remove.
if there is no certificateThe documentation was also updated to include the added output.
Types of changes
Paste Link to the issue
Checklist
cargo fmt
as mentioned in CODING_GUIDELINEScargo clippy
as mentioned in CODING_GUIDELINESFurther comments
The change was made because I think it would be good for all the CLI commands that could possibly be invoked by the human, to print human-readable output describing what happened, even if just one sentence, it's better than nothing.
E.g.
tedge cert remove
returnedOk
for bothcert removed
andno cert
cases, but it had no output, so the user wouldn't know what actually happened. Alternativelyno cert
case could return an error, but I'd argue it makes more sense as a success case because the end result is the same as withcert removed
case: there is no cert and a new one can be created.As for the implementation, i separated the logic and printing between 2 impls, but e.g.
cli/certificate/show.rs
just does the printing in the 2nd impl, and if it's fine, then I could also move the print there and avoid some boilerplate.Lastly, sorry if I'm bikeshedding too hard 馃槄