From b4516220b95743b485b9bcd8226285255be9c9c4 Mon Sep 17 00:00:00 2001 From: Daniel Mueller Date: Sat, 5 Jan 2019 19:30:00 -0800 Subject: 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. --- nitrocli/src/args.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'nitrocli/src/args.rs') 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) -> 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); -- cgit v1.2.1