diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2016-05-18 22:27:01 +0200 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2016-05-18 22:29:12 +0200 |
commit | c6821a53cafabc935ebcbaeda9e879d017bc829d (patch) | |
tree | 2b66dfa2a90656ea996acbe764767891bede6d78 /libimagentrytag | |
parent | f4f807bc1344c88e004b6b36af4d10f7e172a0bb (diff) |
Change get_add_tags() to get to-add-tags from top level, if there are any
Diffstat (limited to 'libimagentrytag')
-rw-r--r-- | libimagentrytag/src/ui.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libimagentrytag/src/ui.rs b/libimagentrytag/src/ui.rs index de0cbbfc..474bfd5b 100644 --- a/libimagentrytag/src/ui.rs +++ b/libimagentrytag/src/ui.rs @@ -66,7 +66,13 @@ pub fn tag_argument_name() -> &'static str { /// /// Returns none if the argument was not specified 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 |