use clap::{crate_authors, crate_description, crate_name, App, Arg};
fn main() {
println!(
"{}",
App::new(crate_name!())
.author(crate_authors!())
.about(crate_description!())
.arg(
Arg::with_name("text")
.takes_value(true)
.multiple(true)
.help("Text to convert")
.required(true),
)
.get_matches()
.values_of("text")
.unwrap()
.collect::<Vec<_>>()
.iter()
.map(|word| word
.chars()
.into_iter()
.map(|char| match char.is_alphabetic() {
true => format!(":regional_indicator_{}:", char.to_lowercase()),
false => char.to_string(),
})
.collect::<Vec<String>>()
.join(" "))
.collect::<Vec<String>>()
.join("\n")
)
}