From 6f3fe60e5d0bc3861a3565f7517a0287d69463da Mon Sep 17 00:00:00 2001 From: Takayuki Maeda Date: Mon, 28 Sep 2020 23:42:55 +0900 Subject: [PATCH] remove `blacklist` --- diesel_cli/src/cli.rs | 10 +--------- diesel_cli/src/main.rs | 6 +----- diesel_cli/tests/print_schema.rs | 4 ++-- 3 files changed, 4 insertions(+), 16 deletions(-) diff --git a/diesel_cli/src/cli.rs b/diesel_cli/src/cli.rs index 1ec79e7bb2f5..6743e54554f0 100644 --- a/diesel_cli/src/cli.rs +++ b/diesel_cli/src/cli.rs @@ -124,8 +124,7 @@ pub fn build_cli() -> App<'static, 'static> { .short("o") .long("only-tables") .help("Only include tables from table-name that matches regexp") - .conflicts_with("except-tables") - .conflicts_with("blacklist"), + .conflicts_with("except-tables"), ) .arg( Arg::with_name("except-tables") @@ -134,13 +133,6 @@ pub fn build_cli() -> App<'static, 'static> { .help("Exclude tables from table-name that matches regex") .conflicts_with("only-tables"), ) - .arg( - Arg::with_name("blacklist") - .short("b") - .long("blacklist") - .hidden(true) - .conflicts_with("only-tables"), - ) .arg( Arg::with_name("with-docs") .long("with-docs") diff --git a/diesel_cli/src/main.rs b/diesel_cli/src/main.rs index 72dfe268d6ba..bffb93bd4e09 100644 --- a/diesel_cli/src/main.rs +++ b/diesel_cli/src/main.rs @@ -400,13 +400,9 @@ fn run_infer_schema(matches: &ArgMatches) -> Result<(), Box> { .collect::>() .map_err(|e| format!("invalid argument for table filtering regex: {}", e)); - if matches.is_present("blacklist") { - eprintln!("The `blacklist` option has been deprecated and renamed to `except-tables`."); - } - if matches.is_present("only-tables") { config.filter = Filtering::OnlyTables(filter?) - } else if matches.is_present("blacklist") || matches.is_present("except-tables") { + } else if matches.is_present("except-tables") { config.filter = Filtering::ExceptTables(filter?) } diff --git a/diesel_cli/tests/print_schema.rs b/diesel_cli/tests/print_schema.rs index 2bd62b05f5af..f4cd6d55f486 100644 --- a/diesel_cli/tests/print_schema.rs +++ b/diesel_cli/tests/print_schema.rs @@ -34,7 +34,7 @@ fn run_infer_schema_include_regex() { fn run_infer_schema_exclude() { test_print_schema( "print_schema_except_tables", - vec!["--with-docs", "-b", "users1"], + vec!["--with-docs", "-e", "users1"], ); } @@ -42,7 +42,7 @@ fn run_infer_schema_exclude() { fn run_infer_schema_exclude_regex() { test_print_schema( "print_schema_except_table_regexes", - vec!["--with-docs", "-b", "users1"], + vec!["--with-docs", "-e", "users1"], ); }