added option to change bubble border

This commit is contained in:
spiders 2022-05-04 20:04:26 -07:00
parent 3465856e76
commit 8d22118c82
2 changed files with 10 additions and 6 deletions

View file

@ -24,7 +24,7 @@ impl BubbleConfig {
anchor: usize, anchor: usize,
wrap: usize, wrap: usize,
no_wrap: bool, no_wrap: bool,
border: Option<String>, border: &Option<String>,
) -> BubbleConfig { ) -> BubbleConfig {
if let Some(border) = border { if let Some(border) = border {
let chars = split::graphemes(&border); let chars = split::graphemes(&border);

View file

@ -45,9 +45,12 @@ struct Args {
#[clap(short = 'o', long)] #[clap(short = 'o', long)]
ijo: Option<String>, ijo: Option<String>,
#[clap(long)] #[clap(short = 'i', long)]
palisa: Option<String>, palisa: Option<String>,
#[clap(short = 'u', long)]
poki: Option<String>,
#[clap(short = 'f', long)] #[clap(short = 'f', long)]
nimi: Option<String>, nimi: Option<String>,
@ -60,6 +63,9 @@ struct Args {
#[clap(short = 'k', long)] #[clap(short = 'k', long)]
kule: Vec<String>, kule: Vec<String>,
#[clap(short = 'l', long)]
seme: bool,
// implementation of classic cowsay flags // implementation of classic cowsay flags
#[clap(short = 'b', long)] #[clap(short = 'b', long)]
ilo: bool, ilo: bool,
@ -85,7 +91,7 @@ struct Args {
#[clap(short = 'y', long)] #[clap(short = 'y', long)]
lili: bool, lili: bool,
#[clap(long)] #[clap(short = 'I', long)]
pilin: bool, pilin: bool,
// optional text input // optional text input
@ -193,7 +199,7 @@ impl Args {
critter_config.template.anchor, critter_config.template.anchor,
self.pakala, self.pakala,
self.pakala_ala, self.pakala_ala,
None, &self.poki,
); );
(critter_config, bubble_config) (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)); print!("{}", bubble_config.bubble_from_text(text));
println!("{}", critter_config.format_critter()) println!("{}", critter_config.format_critter())
} }
const DEFAULT_MAXIMUM_LINE_LENGTH: usize = 40;