ockam
ockam copied to clipboard
Use `Terminal` to print output instead of `println` in the `secure-channel delete` command
Current behavior
The secure-channel show
command is using println
to print the command's output, which is a strategy that is being deprecated.
Desired behavior
Instead, the Terminal
struct should be used to handle the output of every command.
Implementation details
The following function should be refactored:
https://github.com/build-trust/ockam/blob/9c49e470a574d91854aa24628584eda4554aaad0/implementations/rust/ockam/ockam_command/src/secure_channel/delete.rs#L49
You have to extract the printed contents into two variables (one for plain
and another for json) and use the
Terminal` struct as follows to print the command output:
opts.terminal
.stdout()
.plain(plain)
.json(json)
.write_line()?;
Some tips for newcomers:
- Create a new branch for the issue you are working on (don't push directly to your fork's
develop
branch) - Run
cargo fmt
. You can configure the editor to run it automatically everytime a file is saved - Run
cargo clippy
to make sure the code compiles + follows rust standards/best practices - You don't need to keep your branch updated with
develop
until there is a merge conflict. If you still want to update it, usegit rebase develop
instead ofgir merge develop
We love helping new contributors! ❤️ If you have questions or need help as you explore, please join us on Discord. If you're looking for other issues to contribute to, please checkout our good first issues.