From ed724d3726356edb1753b21ec3860fe512c1b4ea Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Wed, 18 May 2016 22:28:15 +0200 Subject: [PATCH] Change get_remove_tags() to get to-remove-tags from top level if there are any --- libimagentrytag/src/ui.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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> { /// /// Returns none if the argument was not specified pub fn get_remove_tags(matches: &ArgMatches) -> Option> { - 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> {