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
developbranch) - Run
cargo fmt. You can configure the editor to run it automatically everytime a file is saved - Run
cargo clippyto make sure the code compiles + follows rust standards/best practices - You don't need to keep your branch updated with
developuntil there is a merge conflict. If you still want to update it, usegit rebase developinstead 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.
Can I work on it?
can I work on this?
@adrianbenavides this sounds interesting can u assign this to me ?
@abhi-yo That's awesome, this is all yours. Please let us know if you have any questions as you explore. You can also ask questions on the contributors discord https://discord.gg/RAbjRr3kds
If this issue is still prevalent I can start working on this right now.
This command was already refactored, but there is another one that needs the same fix: tcp-connection show. Check it out and let me know if you have nay questions. I can also create a new issue for this if you want