From 711627bfe84dbc594708f5784284d3a34ef067f0 Mon Sep 17 00:00:00 2001 From: David Peter Date: Mon, 11 Dec 2023 23:00:49 +0100 Subject: Rename ascii-only to 'default', as it is not only ASCII --- src/lib.rs | 14 +++++++------- src/main.rs | 10 +++++----- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 0745e1a..c63485b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -25,7 +25,7 @@ pub enum ByteCategory { #[derive(Copy, Clone)] #[non_exhaustive] pub enum CharacterTable { - AsciiOnly, + Default, CP437, } @@ -75,7 +75,7 @@ impl Byte { fn as_char(self, character_table: CharacterTable) -> char { use crate::ByteCategory::*; match character_table { - CharacterTable::AsciiOnly => match self.category() { + CharacterTable::Default => match self.category() { Null => '⋄', AsciiPrintable => self.0 as char, AsciiWhitespace if self.0 == 0x20 => ' ', @@ -183,7 +183,7 @@ impl<'a, Writer: Write> PrinterBuilder<'a, Writer> { group_size: 1, base: Base::Hexadecimal, endianness: Endianness::Big, - character_table: CharacterTable::AsciiOnly, + character_table: CharacterTable::Default, } } @@ -744,7 +744,7 @@ mod tests { 1, Base::Hexadecimal, Endianness::Big, - CharacterTable::AsciiOnly, + CharacterTable::Default, ); printer.print_all(input).unwrap(); @@ -800,7 +800,7 @@ mod tests { 1, Base::Hexadecimal, Endianness::Big, - CharacterTable::AsciiOnly, + CharacterTable::Default, ); printer.display_offset(0xdeadbeef); @@ -835,7 +835,7 @@ mod tests { 1, Base::Hexadecimal, Endianness::Big, - CharacterTable::AsciiOnly, + CharacterTable::Default, ); printer.print_all(input).unwrap(); @@ -896,7 +896,7 @@ mod tests { 1, Base::Hexadecimal, Endianness::Big, - CharacterTable::AsciiOnly, + CharacterTable::Default, ); printer.print_all(input).unwrap(); diff --git a/src/main.rs b/src/main.rs index cdada0c..7cabed2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -217,12 +217,12 @@ fn run() -> Result<()> { Arg::new("character-table") .long("character-table") .value_name("FORMAT") - .value_parser(["codepage-437", "ascii-only"]) - .default_value("ascii-only") + .value_parser(["default", "codepage-437"]) + .default_value("default") .help( - "The character table that should be used. 'ascii-only' \ + "The character table that should be used. 'default' \ will show dots for non-ASCII characters, 'codepage-437' \ - will use Code page 437 for those characters." + will use code page 437 for those characters." ), ) .arg( @@ -496,7 +496,7 @@ fn run() -> Result<()> { .unwrap() .as_ref() { - "ascii-only" => CharacterTable::AsciiOnly, + "default" => CharacterTable::Default, "codepage-437" => CharacterTable::CP437, _ => unreachable!(), }; -- cgit v1.2.3