From 5f0373184fff5b66770a7591e2581aaf21fe3ae2 Mon Sep 17 00:00:00 2001 From: David Peter Date: Wed, 10 May 2023 22:09:19 +0200 Subject: [PATCH] Add --characters, change meaning of -C This changes the meaning of `-C` to "show the character panel". The long version `--no-characters` can still be used to hide the character panel. closes #187 --- src/bin/hexyl.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/bin/hexyl.rs b/src/bin/hexyl.rs index f59640d..5456c32 100644 --- a/src/bin/hexyl.rs +++ b/src/bin/hexyl.rs @@ -128,10 +128,17 @@ fn run() -> Result<()> { )) .arg( Arg::new("no_chars") - .short('C') .long("no-characters") .action(ArgAction::SetFalse) - .help("Whether to display the character panel on the right."), + .help("Do not show the character panel on the right."), + ) + .arg( + Arg::new("chars") + .short('C') + .long("characters") + .overrides_with("no_chars") + .action(ArgAction::SetTrue) + .help("Show the character panel on the right. This is the default, unless --no-characters has been specified."), ) .arg( Arg::new("no_position")