Skip to main content

parse_goal_slash_command

Function parse_goal_slash_command 

Source
pub fn parse_goal_slash_command(
    arguments: &str,
) -> Result<GoalSlashCommand, GoalSlashCommandParseError>
Expand description

Parse the arguments written after /goal.

A single token matching a verb (status, edit, pause, resume, clear, ASCII case-insensitive) selects that verb; anything else — including multi-word input starting with a verb word — is the new objective. The empty string shows the goal status. budget is the one verb that takes an argument: bare it shows the budget, otherwise the tail must be a non-negative integer (0 clears), else parsing fails rather than silently replacing the goal with a mistyped budget.