Skip to content

Fix Console schedule argument splitting to respect quoted values - #33

Open
arskinner wants to merge 1 commit into
panlatent:1.xfrom
arskinner:fix/console-schedule-quoted-arguments
Open

Fix Console schedule argument splitting to respect quoted values#33
arskinner wants to merge 1 commit into
panlatent:1.xfrom
arskinner:fix/console-schedule-quoted-arguments

Conversation

@arskinner

Copy link
Copy Markdown

Summary

Follows up on #28, which fixed Console::buildCommand() splitting multi-argument command strings, but used a naive explode(' ', $this->arguments). As noted in review on that PR, this breaks any argument value wrapped in quotes — e.g. --message="hello world" --force gets split into --message="hello, world", --force instead of --message=hello world, --force.

This PR replaces the plain explode() with a parseArguments() helper that treats "..." and '...' spans as a single argument (keeping embedded spaces intact) and strips the delimiting quotes from the result.

Test plan

Verified with representative inputs:

  • a b c['a', 'b', 'c']
  • --message="hello world" --force['--message=hello world', '--force']
  • 'single quoted value' next['single quoted value', 'next']
  • null / empty string → []

php -l passes on the changed file.

🤖 Generated with Claude Code

explode(' ', ...) broke any argument value wrapped in quotes (e.g.
--message="hello world" split into --message="hello and world").
parseArguments() now keeps quoted spans intact as a single argument
and strips the delimiting quotes afterward.

Addresses review feedback on panlatent#28.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant