From 723dd6ec2c9699e666f2bc62deda92acb7e300c9 Mon Sep 17 00:00:00 2001 From: Arijit Basu Date: Wed, 26 Oct 2022 18:50:08 +0530 Subject: [PATCH] Even better error messages --- src/cli.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cli.rs b/src/cli.rs index 3e0aa9b..d02aff3 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -189,7 +189,7 @@ fn fmt_msg_in(args: Vec) -> Result { } ('q', Some('%')) => { let arg = args.next().context(format!( - "argument missing for the placeholder at col {}", + "argument missing for the placeholder at column {}", col ))?; msg.push_str(&json::to_string(&arg)?); @@ -197,7 +197,7 @@ fn fmt_msg_in(args: Vec) -> Result { } ('s', Some('%')) => { let arg = args.next().context(format!( - "argument missing for the placeholder at col {}", + "argument missing for the placeholder at column {}", col ))?; msg.push_str(&arg); @@ -205,7 +205,7 @@ fn fmt_msg_in(args: Vec) -> Result { } (ch, Some('%')) => { bail!(format!( - "invalid placeholder (%{}) at col {}, use one of %s %q %%", + "invalid placeholder '%{}' at column {}, use one of '%s' or '%q', or escape it using '%%'", ch, col )); }