Skip to content

Fix parsing failure when prompt text starts with -- and contains a space - #1548

Open
ikatyal2110 wants to merge 1 commit into
simonw:mainfrom
ikatyal2110:fix-option-like-prompt-args
Open

Fix parsing failure when prompt text starts with -- and contains a space#1548
ikatyal2110 wants to merge 1 commit into
simonw:mainfrom
ikatyal2110:fix-option-like-prompt-args

Conversation

@ikatyal2110

Copy link
Copy Markdown
Contributor

Running llm "--find me" failed with "No such option: --find me" because click-default-group dispatches the quoted string as arg0 to the prompt subcommand, which then tries to parse it as an option flag. Option names cannot contain spaces, so a custom DefaultGroup subclass now inserts '--' before arg0 when it contains a space, telling the subcommand parser to treat it as a positional argument. Fixes #245


Generated by Claude Code

Running `llm "--find me"` failed with "No such option: --find me" because
click-default-group dispatched the quoted string as arg0 to the prompt
subcommand, which then tried to parse it as an option flag. Option names
cannot contain spaces, so a custom DefaultGroup subclass now inserts '--'
before arg0 when it contains a space, telling the subcommand parser to treat
it as a positional argument.

Fixes simonw#245
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.

llm -- "--find me" doesn't work but llm prompt -- "--find me" does

2 participants