better parsing error

This commit is contained in:
Joe 2025-12-21 16:34:14 -08:00
parent 1f109edb35
commit fe1318ba4b

View file

@ -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 {