diff --git a/sea-orm-cli/src/cli.rs b/sea-orm-cli/src/cli.rs index edc43a374..1d797aa03 100644 --- a/sea-orm-cli/src/cli.rs +++ b/sea-orm-cli/src/cli.rs @@ -141,7 +141,7 @@ pub enum GenerateSubcommands { takes_value = true, help = "Generate entity file for specified tables only (comma separated)" )] - tables: Option, + tables: Vec, #[clap( value_parser, diff --git a/sea-orm-cli/src/commands/generate.rs b/sea-orm-cli/src/commands/generate.rs index b73fe3c3e..75f61318f 100644 --- a/sea-orm-cli/src/commands/generate.rs +++ b/sea-orm-cli/src/commands/generate.rs @@ -56,19 +56,8 @@ pub async fn run_generate_command( // above let is_sqlite = url.scheme() == "sqlite"; - let tables = match tables { - Some(t) => t, - _ => "".to_string(), - }; - // Closures for filtering tables - let filter_tables = |table: &str| -> bool { - if !tables.is_empty() { - return tables.contains(table); - } - - true - }; + let filter_tables = |table: &String| -> bool { tables.contains(table) }; let filter_hidden_tables = |table: &str| -> bool { if include_hidden_tables {