From 8d22118c829c97edd38ef39f7b02369d979ac689 Mon Sep 17 00:00:00 2001 From: spiders Date: Wed, 4 May 2022 20:04:26 -0700 Subject: [PATCH] added option to change bubble border --- src/bubbles.rs | 2 +- src/main.rs | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/bubbles.rs b/src/bubbles.rs index ac16908..9978177 100644 --- a/src/bubbles.rs +++ b/src/bubbles.rs @@ -24,7 +24,7 @@ impl BubbleConfig { anchor: usize, wrap: usize, no_wrap: bool, - border: Option, + border: &Option, ) -> BubbleConfig { if let Some(border) = border { let chars = split::graphemes(&border); diff --git a/src/main.rs b/src/main.rs index 16dc23c..45ceabe 100644 --- a/src/main.rs +++ b/src/main.rs @@ -45,9 +45,12 @@ struct Args { #[clap(short = 'o', long)] ijo: Option, - #[clap(long)] + #[clap(short = 'i', long)] palisa: Option, + #[clap(short = 'u', long)] + poki: Option, + #[clap(short = 'f', long)] nimi: Option, @@ -60,6 +63,9 @@ struct Args { #[clap(short = 'k', long)] kule: Vec, + #[clap(short = 'l', long)] + seme: bool, + // implementation of classic cowsay flags #[clap(short = 'b', long)] ilo: bool, @@ -85,7 +91,7 @@ struct Args { #[clap(short = 'y', long)] lili: bool, - #[clap(long)] + #[clap(short = 'I', long)] pilin: bool, // optional text input @@ -193,7 +199,7 @@ impl Args { critter_config.template.anchor, self.pakala, self.pakala_ala, - None, + &self.poki, ); (critter_config, bubble_config) @@ -204,5 +210,3 @@ fn output(text: &str, critter_config: CritterConfig, bubble_config: BubbleConfig print!("{}", bubble_config.bubble_from_text(text)); println!("{}", critter_config.format_critter()) } - -const DEFAULT_MAXIMUM_LINE_LENGTH: usize = 40;