Remove feature: setting tags
This commit is contained in:
parent
11021906b3
commit
072564f6b8
2 changed files with 2 additions and 19 deletions
|
@ -44,9 +44,8 @@ fn main() {
|
|||
|| {
|
||||
let add = rt.cli().value_of("add");
|
||||
let rem = rt.cli().value_of("remove");
|
||||
let set = rt.cli().value_of("set");
|
||||
|
||||
alter(&rt, id, add, rem, set);
|
||||
alter(&rt, id, add, rem);
|
||||
},
|
||||
|name| {
|
||||
debug!("Call: {}", name);
|
||||
|
@ -60,7 +59,7 @@ fn main() {
|
|||
});
|
||||
}
|
||||
|
||||
fn alter(rt: &Runtime, id: &str, add: Option<&str>, rem: Option<&str>, set: Option<&str>) {
|
||||
fn alter(rt: &Runtime, id: &str, add: Option<&str>, rem: Option<&str>) {
|
||||
let path = {
|
||||
match build_entry_path(rt.store(), id) {
|
||||
Err(e) => {
|
||||
|
@ -93,14 +92,6 @@ fn alter(rt: &Runtime, id: &str, add: Option<&str>, rem: Option<&str>, set: Opti
|
|||
}
|
||||
}
|
||||
});
|
||||
|
||||
set.map(|tags| {
|
||||
info!("Setting tags '{}'", tags);
|
||||
let tags : Vec<_> = tags.split(',').map(String::from).collect();
|
||||
if let Err(e) = e.set_tags(&tags) {
|
||||
trace_error(&e);
|
||||
}
|
||||
});
|
||||
})
|
||||
.map_err(|e| {
|
||||
info!("No entry.");
|
||||
|
|
|
@ -24,14 +24,6 @@ pub fn build_ui<'a>(app: App<'a, 'a>) -> App<'a, 'a> {
|
|||
.multiple(true)
|
||||
.help("Remove this tag"))
|
||||
|
||||
.arg(Arg::with_name("set")
|
||||
.long("set")
|
||||
.short("s")
|
||||
.takes_value(true)
|
||||
.required(false)
|
||||
.multiple(true)
|
||||
.help("Set these tags"))
|
||||
|
||||
.subcommand(SubCommand::with_name("list")
|
||||
.about("List tags (default)")
|
||||
.version("0.1")
|
||||
|
|
Loading…
Reference in a new issue