diff --git a/cli/src/argparse/args/colon.rs b/cli/src/argparse/args/colon.rs index ecf1af6c9..3fa17ce97 100644 --- a/cli/src/argparse/args/colon.rs +++ b/cli/src/argparse/args/colon.rs @@ -5,8 +5,8 @@ use nom::bytes::complete::tag as nomtag; use nom::{branch::*, character::complete::*, combinator::*, sequence::*, IResult}; use taskchampion::Status; -/// Recognizes a colon-prefixed pair -fn colon_prefixed(prefix: &'static str) -> impl Fn(&str) -> IResult<&str, &str> { +/// Recognizes up to the colon of the common `:...` syntax +fn colon_prefix(prefix: &'static str) -> impl Fn(&str) -> IResult<&str, &str> { fn to_suffix<'a>(input: (&'a str, char, &'a str)) -> Result<&'a str, ()> { Ok(input.2) } @@ -28,7 +28,7 @@ pub(crate) fn status_colon(input: &str) -> IResult<&str, Status> { _ => Err(()), } } - map_res(colon_prefixed("status"), to_status)(input) + map_res(colon_prefix("status"), to_status)(input) } /// Recognizes `wait:` to None and `wait:` to `Some(ts)` @@ -53,10 +53,10 @@ mod test { use super::*; #[test] - fn test_colon_prefixed() { - assert_eq!(colon_prefixed("foo")("foo:abc").unwrap().1, "abc"); - assert_eq!(colon_prefixed("foo")("foo:").unwrap().1, ""); - assert!(colon_prefixed("foo")("foo").is_err()); + fn test_colon_prefix() { + assert_eq!(colon_prefix("foo")("foo:abc").unwrap().1, "abc"); + assert_eq!(colon_prefix("foo")("foo:").unwrap().1, ""); + assert!(colon_prefix("foo")("foo").is_err()); } #[test] diff --git a/cli/src/argparse/modification.rs b/cli/src/argparse/modification.rs index dcdc3d303..083f7fc8e 100644 --- a/cli/src/argparse/modification.rs +++ b/cli/src/argparse/modification.rs @@ -154,9 +154,9 @@ impl Modification { syntax: "wait:", summary: "Set or unset the task's wait time", description: " - Set the time before which the task is not actionable and - should not be shown in reports. With `wait:`, the time - is un-set. See the documentation for the timestamp syntax.", + Set the time before which the task is not actionable and should not be shown in + reports, e.g., `wait:3day` to wait for three days. With `wait:`, the time is + un-set. See the documentation for the timestamp syntax.", }); } } diff --git a/cli/src/invocation/cmd/info.rs b/cli/src/invocation/cmd/info.rs index f450b7a6f..c77476a69 100644 --- a/cli/src/invocation/cmd/info.rs +++ b/cli/src/invocation/cmd/info.rs @@ -36,8 +36,8 @@ pub(crate) fn execute( tags.sort(); t.add_row(row![b->"Tags", tags.join(" ")]); } - if task.is_waiting() { - t.add_row(row![b->"Wait", task.get_wait().unwrap()]); + if let Some(wait) = task.get_wait() { + t.add_row(row![b->"Wait", wait]); } } t.print(w)?;