Fix: "status" subcommand might not be present
If we call 'imag-habit' without a subcommand, we assume "today". Thus it might occur that the "status" subcommand match is not present, hence we have to assume `false` here as default value. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
This commit is contained in:
parent
e25cf17a8a
commit
84aef82258
1 changed files with 5 additions and 1 deletions
|
@ -254,7 +254,11 @@ fn today(rt: &Runtime, future: bool) {
|
|||
let done = scmd.is_present("today-done");
|
||||
(futu, done)
|
||||
} else {
|
||||
(true, rt.cli().subcommand_matches("status").unwrap().is_present("status-done"))
|
||||
if let Some(status) = rt.cli().subcommand_matches("status") {
|
||||
(true, status.is_present("status-done"))
|
||||
} else {
|
||||
(true, false)
|
||||
}
|
||||
}
|
||||
};
|
||||
let today = ::chrono::offset::Local::today().naive_local();
|
||||
|
|
Loading…
Reference in a new issue