#![warn(clippy::all, clippy::nursery, clippy::pedantic, clippy::cargo)]

use pinchar::characters_from_pinyin;
use std::env;

fn main() {
    for pinyin in env::args().skip(1) {
        find_characters(&pinyin);
        println!("\n---");
    }

}

fn find_characters(pinyin: &str) {
    let characters = characters_from_pinyin(pinyin);
    println!("{pinyin}: {} character(s) found:", characters.len());
    for character in characters {
        print!("{character} ");
    }
}
