Skip to content

Commit

Permalink
remove blacklist
Browse files Browse the repository at this point in the history
  • Loading branch information
TaKO8Ki committed Sep 28, 2020
1 parent 3065e77 commit 6f3fe60
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 16 deletions.
10 changes: 1 addition & 9 deletions diesel_cli/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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")
Expand Down
6 changes: 1 addition & 5 deletions diesel_cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -400,13 +400,9 @@ fn run_infer_schema(matches: &ArgMatches) -> Result<(), Box<dyn Error>> {
.collect::<Result<_, _>>()
.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?)
}

Expand Down
4 changes: 2 additions & 2 deletions diesel_cli/tests/print_schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ 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"],
);
}

#[test]
fn run_infer_schema_exclude_regex() {
test_print_schema(
"print_schema_except_table_regexes",
vec!["--with-docs", "-b", "users1"],
vec!["--with-docs", "-e", "users1"],
);
}

Expand Down

0 comments on commit 6f3fe60

Please sign in to comment.