diff options
-rw-r--r-- | fatcat-cli/src/commands.rs | 6 | ||||
-rw-r--r-- | fatcat-cli/src/main.rs | 24 |
2 files changed, 26 insertions, 4 deletions
diff --git a/fatcat-cli/src/commands.rs b/fatcat-cli/src/commands.rs index 87a0f5a..da23c34 100644 --- a/fatcat-cli/src/commands.rs +++ b/fatcat-cli/src/commands.rs @@ -447,8 +447,12 @@ impl BatchGrouper { batch_size: u64, limit: Option<u64>, auto_accept: bool, + editgroup_description: Option<String>, ) -> Self { - let editgroup_description = "part of a fatcat-cli batch operation".to_string(); + let editgroup_description = match editgroup_description { + Some(ed) => ed, + None => "part of a fatcat-cli batch operation".to_string(), + }; BatchGrouper { entity_type, batch_size, diff --git a/fatcat-cli/src/main.rs b/fatcat-cli/src/main.rs index 091d073..f4a8d57 100644 --- a/fatcat-cli/src/main.rs +++ b/fatcat-cli/src/main.rs @@ -108,6 +108,10 @@ enum BatchCommand { #[structopt(long, global = true)] auto_accept: bool, + + /// Editgroup description + #[structopt(long, short)] + description: Option<String>, }, /// Update existing entities in batches @@ -120,6 +124,10 @@ enum BatchCommand { #[structopt(long)] auto_accept: bool, + + /// Editgroup description + #[structopt(long, short)] + description: Option<String>, }, /// Delete entities in batches @@ -131,6 +139,10 @@ enum BatchCommand { #[structopt(long)] auto_accept: bool, + + /// Editgroup description + #[structopt(long, short)] + description: Option<String>, }, /// Download multiple files @@ -484,12 +496,14 @@ fn run(opt: Opt) -> Result<()> { entity_type, batch_size, auto_accept, + description, }, input_path, limit, } => { let input_path = path_or_stdin(input_path); - let mut batch = BatchGrouper::new(entity_type, batch_size, limit, auto_accept); + let mut batch = + BatchGrouper::new(entity_type, batch_size, limit, auto_accept, description); batch.run(&mut api_client, input_path, BatchOp::Create, None)?; } Command::Batch { @@ -499,12 +513,14 @@ fn run(opt: Opt) -> Result<()> { mutations, batch_size, auto_accept, + description, }, input_path, limit, } => { let input_path = path_or_stdin(input_path); - let mut batch = BatchGrouper::new(entity_type, batch_size, limit, auto_accept); + let mut batch = + BatchGrouper::new(entity_type, batch_size, limit, auto_accept, description); batch.run( &mut api_client, input_path, @@ -518,12 +534,14 @@ fn run(opt: Opt) -> Result<()> { entity_type, batch_size, auto_accept, + description, }, input_path, limit, } => { let input_path = path_or_stdin(input_path); - let mut batch = BatchGrouper::new(entity_type, batch_size, limit, auto_accept); + let mut batch = + BatchGrouper::new(entity_type, batch_size, limit, auto_accept, description); batch.run(&mut api_client, input_path, BatchOp::Delete, None)?; } Command::Batch { |