// Rshare - a file sharing program written in Rust.
// Copyright (C) 2017 Cooper Paul EdenDay
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.
//
// Electronic mail: cedenday@protonmail.com
// Paper mail: 100 Front Street, #31, Bath, Maine, 04530, USA

use clap;

use {NAME, VERSION, AUTHORS, DESCRIPTION};

pub fn build_cli<'a>() -> clap::App<'a, 'a> {
    clap::App::new(NAME)
        .version(VERSION)
        .author(AUTHORS)
        .about(DESCRIPTION)
        .arg(clap::Arg::with_name("quiet")
                 .short("q")
                 .long("quiet")
                 .help("Don't print the GPL banner and some notices")
                 .multiple(false)
                 .takes_value(false))
        .arg(clap::Arg::with_name("no-client")
                 .short("n")
                 .long("no-client")
                 .help("Don't start client component.")
                 .multiple(false)
                 .takes_value(false))
        .arg(clap::Arg::with_name("bind")
                 .short("b")
                 .long("bind")
                 .multiple(false)
                 .takes_value(true)
                 .value_name("IP")
                 .help("Bind to a specific <IP>"))
        .arg(clap::Arg::with_name("server")
                 .short("s")
                 .long("server")
                 .help("Connect to server at <IP>")
                 .multiple(true)
                 .takes_value(true)
                 .value_name("IP"))
        .subcommand(clap::SubCommand::with_name("completions")
                        .about("Generates completion scripts for your shell")
                        .arg(clap::Arg::with_name("SHELL")
                                 .required(true)
                                 .possible_values(&["bash", "fish", "zsh"])
                                 .help("The shell to generate the script for")))
}
