rustic_rs/commands/
tag.rs1use abscissa_core::{Command, Runnable};
3use rustic_core::StringList;
4
5use crate::commands::rewrite::RewriteCmd;
6
7#[derive(clap::Parser, Command, Debug)]
9pub(crate) struct TagCmd {
10 #[clap(value_name = "ID")]
13 ids: Vec<String>,
14
15 #[clap(
17 long,
18 value_name = "TAG[,TAG,..]",
19 conflicts_with = "remove",
20 help_heading = "Tag options"
21 )]
22 add: Vec<StringList>,
23
24 #[clap(long, value_name = "TAG[,TAG,..]", help_heading = "Tag options")]
26 remove: Vec<StringList>,
27
28 #[clap(
30 long,
31 value_name = "TAG[,TAG,..]",
32 conflicts_with = "remove",
33 help_heading = "Tag options"
34 )]
35 set: Vec<StringList>,
36}
37
38impl Runnable for TagCmd {
39 fn run(&self) {
40 let rewrite = RewriteCmd {
41 ids: self.ids.clone(),
42 add_tags: self.add.clone(),
43 remove_tags: self.remove.clone(),
44 set_tags: self.set.clone(),
45 ..Default::default()
46 };
47 rewrite.run();
48 }
49}