use clap::{App, AppSettings, Arg, ArgGroup, SubCommand};

pub fn build() -> App<'static, 'static> {
    App::new(crate_name!())
        .about(crate_description!())
        .version(crate_version!())
        .setting(AppSettings::SubcommandRequired)
        .setting(AppSettings::VersionlessSubcommands)
        .subcommand(SubCommand::with_name("digraph")
            .about("Digraph lookup and resolution")
            .setting(AppSettings::AllowLeadingHyphen)
            .setting(AppSettings::UnifiedHelpMessage)
            .arg(Arg::with_name("convert")
                .help("Converts a digraph sequence or a character to the other")
                .long("convert")
                .short("c")
                .takes_value(true))
            .arg(Arg::with_name("filter")
                .help("Prints information about matching digraphs")
                .short("f")
                .takes_value(true))
            .arg(Arg::with_name("description")
                .help("Prints results with description")
                .long("description")
                .short("d")
                .requires("filter"))
            .group(ArgGroup::with_name("modes")
                .args(&["convert", "filter"])
                .required(true)))
}
                .long("filter")