Document filter and modification syntax

This commit is contained in:
Dustin J. Mitchell
2020-12-24 17:04:51 +00:00
parent 9c94a7b753
commit 8c9e240e97
5 changed files with 141 additions and 2 deletions

View File

@@ -1,8 +1,10 @@
use super::args::{any, arg_matching, minus_tag, plus_tag};
use super::ArgList;
use crate::usage;
use nom::{branch::alt, combinator::*, multi::fold_many0, IResult};
use std::collections::HashSet;
use taskchampion::Status;
use textwrap::dedent;
#[derive(Debug, PartialEq, Clone)]
pub enum DescriptionMod {
@@ -107,6 +109,34 @@ impl Modification {
}
map_res(arg_matching(minus_tag), to_modarg)(input)
}
pub(super) fn get_usage(u: &mut usage::Usage) {
u.modifications.push(usage::Modification {
syntax: "DESCRIPTION".to_owned(),
summary: "Set description".to_owned(),
description: dedent(
"
Set the task description. Multiple arguments are combined into a single
space-separated description.",
),
});
u.modifications.push(usage::Modification {
syntax: "+TAG".to_owned(),
summary: "Tag task".to_owned(),
description: dedent(
"
Add the given tag to the task.",
),
});
u.modifications.push(usage::Modification {
syntax: "-TAG".to_owned(),
summary: "Un-tag task".to_owned(),
description: dedent(
"
Remove the given tag from the task.",
),
});
}
}
#[cfg(test)]