From 9b5620e2021c83dfe6bf68b4f64b749454b74287 Mon Sep 17 00:00:00 2001 From: jakobst1n Date: Wed, 12 Jun 2024 17:56:16 +0200 Subject: Add option for 8dot braille --- src/parseopts.rs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/parseopts.rs') diff --git a/src/parseopts.rs b/src/parseopts.rs index 2615ad2..3a06114 100644 --- a/src/parseopts.rs +++ b/src/parseopts.rs @@ -1,4 +1,4 @@ -use crate::graph::GraphType; +use crate::graph::{BrailleType, GraphType}; use std::str::FromStr; use std::io::IsTerminal; @@ -83,7 +83,7 @@ macro_rules! parseopts_panic { println!(" -b, --braille Shorthand for -t braille"); println!(" -a, --ascii Shorthand for -t ascii"); println!( - " -t TYPE Set graph type, valid options are 'star', 'ascii' or 'braille'" + " -t TYPE Set graph type, valid options are 'star', 'ascii', 'braille', 'braille6' or 'braille8'" ); println!(" -n, --last-n N Only include N samples in plot"); println!(" -c, --cut Special case of --last-n, where N is set to --width"); @@ -117,8 +117,11 @@ pub fn parseopt(opts: &mut OptsBuilder, arg: &str, value: Option, progna "ascii" => { opts.graph_type = GraphType::Ascii; } - "braille" => { - opts.graph_type = GraphType::Braille; + "braille" | "braille6" => { + opts.graph_type = GraphType::Braille(BrailleType::dot6); + } + "braille8" => { + opts.graph_type = GraphType::Braille(BrailleType::dot8); } t => { println!( @@ -158,7 +161,7 @@ pub fn parseopt(opts: &mut OptsBuilder, arg: &str, value: Option, progna opts.graph_type = GraphType::Ascii; } "b" | "braille" => { - opts.graph_type = GraphType::Braille; + opts.graph_type = GraphType::Braille(BrailleType::dot6); } "c" | "cut" => { opts.cut = true; -- cgit v1.2.3