Remove test-bins feature.

This commit is contained in:
Andrés N. Robalino
2020-05-17 22:52:56 -05:00
parent d1b1438ce5
commit f18424a6f6
13 changed files with 134 additions and 126 deletions

View File

@ -1,5 +1,6 @@
use clap::{App, Arg};
use log::LevelFilter;
use nu_cli::utils::test_bins as binaries;
use nu_cli::{create_default_context, EnvironmentSyncer};
use std::error::Error;
use std::fs::File;
@ -16,6 +17,14 @@ fn main() -> Result<(), Box<dyn Error>> {
.possible_values(&["error", "warn", "info", "debug", "trace"])
.takes_value(true),
)
.arg(
Arg::with_name("testbin")
.hidden(true)
.long("testbin")
.value_name("TESTBIN")
.possible_values(&["cococo", "iecho", "fail", "nonu", "chop"])
.takes_value(true),
)
.arg(
Arg::with_name("commands")
.short("c")
@ -48,6 +57,19 @@ fn main() -> Result<(), Box<dyn Error>> {
)
.get_matches();
if let Some(bin) = matches.value_of("testbin") {
match bin {
"cococo" => binaries::cococo(),
"iecho" => binaries::iecho(),
"fail" => binaries::fail(),
"nonu" => binaries::nonu(),
"chop" => binaries::chop(),
_ => unreachable!(),
}
return Ok(());
}
let loglevel = match matches.value_of("loglevel") {
None => LevelFilter::Warn,
Some("error") => LevelFilter::Error,