summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2018-03-02 22:07:38 +0100
committerMatthias Beyer <mail@beyermatthias.de>2018-03-02 22:07:38 +0100
commit9ec09659254c1eeb64596229bce79095a1325dac (patch)
tree3cf23a6b66e11f192c045516d22e1d786b024b31
parentbc3b770fb2266541da33fc06989aa65d145c11a9 (diff)
Fix order of evaluation
We need to evaluate the commandline argument first and if there is none, we use the default. This patch fixes that bug. --- Cherry-picked from 0cde88d661c414e74afd8f30b579de51273e959d and changelog for next release added.
-rw-r--r--bin/domain/imag-diary/src/util.rs6
-rw-r--r--doc/src/09020-changelog.md6
2 files changed, 10 insertions, 2 deletions
diff --git a/bin/domain/imag-diary/src/util.rs b/bin/domain/imag-diary/src/util.rs
index 9f96569..aeff186 100644
--- a/bin/domain/imag-diary/src/util.rs
+++ b/bin/domain/imag-diary/src/util.rs
@@ -26,8 +26,10 @@ use toml_query::read::TomlValueReadExt;
pub fn get_diary_name(rt: &Runtime) -> Option<String> {
use libimagdiary::config::get_default_diary_name;
- get_default_diary_name(rt)
- .or(rt.cli().value_of("diaryname").map(String::from))
+ rt.cli()
+ .value_of("diaryname")
+ .map(String::from)
+ .or_else(|| get_default_diary_name(rt))
}
pub enum Timed {
diff --git a/doc/src/09020-changelog.md b/doc/src/09020-changelog.md
index 0730d13..f14efc7 100644
--- a/doc/src/09020-changelog.md
+++ b/doc/src/09020-changelog.md
@@ -22,6 +22,12 @@ This section contains the changelog from the last release to the next release.
* Minor changes
* Bugfixes
+## 0.6.2
+
+Bugfix release for fixing:
+
+* `imag-diary` did not recognize the "-d DIARY" setting.
+
## 0.6.1