diff options
author | Daniel Mueller <deso@posteo.net> | 2019-01-05 19:30:00 -0800 |
---|---|---|
committer | Daniel Mueller <deso@posteo.net> | 2019-01-05 19:30:00 -0800 |
commit | b4516220b95743b485b9bcd8226285255be9c9c4 (patch) | |
tree | 389d17e14b012c64f57a0947257d298ebea29789 /nitrocli/src/args.rs | |
parent | 6d07a0c9d9a9b39247a9727dea2d90eba4e1fe9e (diff) | |
download | nitrocli-b4516220b95743b485b9bcd8226285255be9c9c4.tar.gz nitrocli-b4516220b95743b485b9bcd8226285255be9c9c4.tar.bz2 |
Emit all output to custom stdio channels
This change continues and concludes the effort of using customizable
stdio channels for output of data from the program. It does so by
replacing the standard println macro with a custom one that outputs the
data to the supplied context's stdout object.
Because this object is injected from the main function, it will be
possible for tests invoking this function to supply custom Write objects
that can buffer this data and make it available for verification
purposes.
Diffstat (limited to 'nitrocli/src/args.rs')
-rw-r--r-- | nitrocli/src/args.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/nitrocli/src/args.rs b/nitrocli/src/args.rs index f689643..76b9766 100644 --- a/nitrocli/src/args.rs +++ b/nitrocli/src/args.rs @@ -815,7 +815,10 @@ pub fn otp_set(ctx: &mut ExecCtx<'_>, args: Vec<String>) -> Result<()> { )); } - println!("Warning: The --ascii option is deprecated. Please use --format ascii instead."); + println!( + ctx, + "Warning: The --ascii option is deprecated. Please use --format ascii instead." + )?; secret_format = Some(OtpSecretFormat::Ascii); } let secret_format = secret_format.unwrap_or(OtpSecretFormat::Hex); |