summaryrefslogtreecommitdiffstats
path: root/libimagentrytag
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2016-05-18 22:28:15 +0200
committerMatthias Beyer <mail@beyermatthias.de>2016-05-18 22:29:12 +0200
commited724d3726356edb1753b21ec3860fe512c1b4ea (patch)
tree9bc6ef232c99e8a1f63ff03877b33bdc464e12f7 /libimagentrytag
parentc6821a53cafabc935ebcbaeda9e879d017bc829d (diff)
Change get_remove_tags() to get to-remove-tags from top level if there are any
Diffstat (limited to 'libimagentrytag')
-rw-r--r--libimagentrytag/src/ui.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/libimagentrytag/src/ui.rs b/libimagentrytag/src/ui.rs
index 474bfd5b..70b9337e 100644
--- a/libimagentrytag/src/ui.rs
+++ b/libimagentrytag/src/ui.rs
@@ -79,7 +79,13 @@ pub fn get_add_tags(matches: &ArgMatches) -> Option<Vec<Tag>> {
///
/// Returns none if the argument was not specified
pub fn get_remove_tags(matches: &ArgMatches) -> Option<Vec<Tag>> {
- extract_tags(matches, "remove-tags", '-')
+ if let Some(v) = extract_tags(matches, tag_subcommand_remove_arg_name(), '-') {
+ return Some(v);
+ } else {
+ matches
+ .values_of(tag_subcommand_remove_arg_name())
+ .map(|values| values.map(String::from).collect())
+ }
}
fn extract_tags(matches: &ArgMatches, specifier: &str, specchar: char) -> Option<Vec<Tag>> {