Skip to content

Commit

Permalink
Improve command parser
Browse files Browse the repository at this point in the history
  • Loading branch information
onatm committed Feb 18, 2021
1 parent dc40a93 commit b21f505
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,11 @@ named!(
);

named!(
rest<CompleteStr, String>,
parse_to!(String)
command<CompleteStr, String>,
do_parse!(
multispace0 >>
command: take_while!(|c: char| c.is_alphanumeric() || c == '/' || c.is_whitespace()) >> (String::from(command.0))
)
);

named!(
Expand All @@ -76,7 +79,7 @@ named!(
day_of_month: cron_expression_list >>
month: cron_expression_list >>
day_of_week: cron_expression_list >>
command: rest >>
command: command >>
eof!() >> (minute, hour, day_of_month, month, day_of_week, command)
)
),
Expand Down

0 comments on commit b21f505

Please sign in to comment.