diff --git a/leo/commands/login.rs b/leo/commands/login.rs index 52aee8d0b8..bc0c96ecf9 100644 --- a/leo/commands/login.rs +++ b/leo/commands/login.rs @@ -139,91 +139,4 @@ impl CLI for LoginCommand { } } } - - fn new<'a, 'b>() -> clap::App<'a, 'b> { - let arguments = &Self::ARGUMENTS - .iter() - .map(|a| { - let mut args = clap::Arg::with_name(a.0).help(a.1).required(a.3).index(a.4); - if !a.2.is_empty() { - args = args.possible_values(a.2); - } - args - }) - .collect::>>(); - let flags = &Self::FLAGS - .iter() - .map(|a| clap::Arg::from_usage(a)) - .collect::>>(); - let options = &Self::OPTIONS - .iter() - .map(|a| match !a.2.is_empty() { - true => clap::Arg::from_usage(a.0) - .conflicts_with_all(a.1) - .possible_values(a.2) - .requires_all(a.3), - false => clap::Arg::from_usage(a.0).conflicts_with_all(a.1).requires_all(a.3), - }) - .collect::>>(); - let subcommands = Self::SUBCOMMANDS.iter().map(|s| { - clap::SubCommand::with_name(s.0) - .about(s.1) - .args( - &s.2.iter() - .map(|a| { - let mut args = clap::Arg::with_name(a.0).help(a.1).required(a.3).index(a.4); - if !a.2.is_empty() { - args = args.possible_values(a.2); - } - args - }) - .collect::>>(), - ) - .args( - &s.3.iter() - .map(|a| clap::Arg::from_usage(a)) - .collect::>>(), - ) - .args( - &s.4.iter() - .map(|a| match !a.2.is_empty() { - true => clap::Arg::from_usage(a.0) - .conflicts_with_all(a.1) - .possible_values(a.2) - .requires_all(a.3), - false => clap::Arg::from_usage(a.0).conflicts_with_all(a.1).requires_all(a.3), - }) - .collect::>>(), - ) - .settings(s.5) - }); - - clap::SubCommand::with_name(Self::NAME) - .about(Self::ABOUT) - .settings(&[ - clap::AppSettings::ColoredHelp, - clap::AppSettings::DisableHelpSubcommand, - clap::AppSettings::DisableVersion, - ]) - .args(arguments) - .args(flags) - .args(options) - .subcommands(subcommands) - } - - fn process(arguments: &clap::ArgMatches) -> Result<(), CLIError> { - // Set logging environment - match arguments.is_present("debug") { - true => crate::logger::init_logger("leo", 2), - false => crate::logger::init_logger("leo", 1), - } - - if arguments.subcommand().0 != "update" { - crate::updater::Updater::print_cli(); - } - - let options = Self::parse(arguments)?; - let _output = Self::output(options)?; - Ok(()) - } }