better parsing error
This commit is contained in:
parent
1f109edb35
commit
fe1318ba4b
1 changed files with 4 additions and 4 deletions
|
|
@ -16,7 +16,7 @@ use winnow::{
|
||||||
Parser,
|
Parser,
|
||||||
ascii::{newline, space0},
|
ascii::{newline, space0},
|
||||||
combinator::{alt, eof, fail},
|
combinator::{alt, eof, fail},
|
||||||
error::StrContext,
|
error::{StrContext, StrContextValue},
|
||||||
token::take_while,
|
token::take_while,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -237,9 +237,9 @@ fn parse_command<'i>(input: &mut &'i str) -> winnow::Result<FeedCommand<'i>> {
|
||||||
"add",
|
"add",
|
||||||
"remove",
|
"remove",
|
||||||
"help",
|
"help",
|
||||||
fail.context(StrContext::Expected(
|
fail.context(StrContext::Expected(StrContextValue::Description(
|
||||||
"supported commands are `add`, `remove`, or `help`".into(),
|
"`add <feed url>`, `remove <feed url>`, or `help`",
|
||||||
)),
|
))),
|
||||||
)),
|
)),
|
||||||
)
|
)
|
||||||
.map(|(_, a)| match a {
|
.map(|(_, a)| match a {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue