Change get_add_tags() to get to-add-tags from top level, if there are any

This commit is contained in:
Matthias Beyer 2016-05-18 22:27:01 +02:00
parent f4f807bc13
commit c6821a53ca

View file

@ -66,7 +66,13 @@ pub fn tag_argument_name() -> &'static str {
/// ///
/// Returns none if the argument was not specified /// Returns none if the argument was not specified
pub fn get_add_tags(matches: &ArgMatches) -> Option<Vec<Tag>> { pub fn get_add_tags(matches: &ArgMatches) -> Option<Vec<Tag>> {
extract_tags(matches, "add-tags", '+') if let Some(v) = extract_tags(matches, tag_subcommand_add_arg_name(), '+') {
return Some(v);
} else {
matches
.values_of(tag_subcommand_add_arg_name())
.map(|values| values.map(String::from).collect())
}
} }
/// Get the tags which should be removed from the commandline /// Get the tags which should be removed from the commandline