diff options
author | David Peter <mail@david-peter.de> | 2023-12-11 23:00:49 +0100 |
---|---|---|
committer | David Peter <david.peter@bosch.com> | 2023-12-11 23:00:49 +0100 |
commit | 711627bfe84dbc594708f5784284d3a34ef067f0 (patch) | |
tree | 614c3ae299e70586250602297336c71e5567d6a0 | |
parent | ba89e88dfd0e96c5b3e26222aaee0a42c7bd62ea (diff) |
Rename ascii-only to 'default', as it is not only ASCII
-rw-r--r-- | src/lib.rs | 14 | ||||
-rw-r--r-- | src/main.rs | 10 |
2 files changed, 12 insertions, 12 deletions
@@ -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!(), }; |