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,
|
||||
ascii::{newline, space0},
|
||||
combinator::{alt, eof, fail},
|
||||
error::StrContext,
|
||||
error::{StrContext, StrContextValue},
|
||||
token::take_while,
|
||||
};
|
||||
|
||||
|
|
@ -237,9 +237,9 @@ fn parse_command<'i>(input: &mut &'i str) -> winnow::Result<FeedCommand<'i>> {
|
|||
"add",
|
||||
"remove",
|
||||
"help",
|
||||
fail.context(StrContext::Expected(
|
||||
"supported commands are `add`, `remove`, or `help`".into(),
|
||||
)),
|
||||
fail.context(StrContext::Expected(StrContextValue::Description(
|
||||
"`add <feed url>`, `remove <feed url>`, or `help`",
|
||||
))),
|
||||
)),
|
||||
)
|
||||
.map(|(_, a)| match a {
|
||||
|
|
|
|||
Loading…
Reference in a new issue