Skip to content

Fix for #100 : Stop -- parameter being passed literally to command - #101

Merged
AlexSkrypnyk merged 3 commits into
masterfrom
args-bugfix
Aug 5, 2022
Merged

AlexSkrypnyk merged 3 commits into
masterfrom
args-bugfix

Conversation

@ocean

@ocean ocean commented Aug 4, 2022

Copy link
Copy Markdown
Member

No description provided.

@ocean
ocean marked this pull request as ready for review August 4, 2022 07:45
@ocean
ocean requested a review from AlexSkrypnyk August 4, 2022 07:45
@ocean

ocean commented Aug 4, 2022

Copy link
Copy Markdown
Member Author

Fix for #100 for review @AlexSkrypnyk - I've also put out a pre-release so people can grab and test if they like, at https://github.com/ahoy-cli/ahoy/releases/tag/2.0.2-alpha

@AlexSkrypnyk AlexSkrypnyk left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ocean
LGTM

Thank you so much for picking this up so fast!

@AlexSkrypnyk
AlexSkrypnyk merged commit 4827ba1 into master Aug 5, 2022
@AlexSkrypnyk
AlexSkrypnyk deleted the args-bugfix branch August 5, 2022 00:25
@ocean

ocean commented Aug 5, 2022

Copy link
Copy Markdown
Member Author

Ok, I'll put out a full release for this and update Homebrew.

ocean added a commit that referenced this pull request Sep 2, 2026
Ahoy removed every '--' a user typed, so a separator meant as data never
reached the wrapped tool. That silently changed the request for anything
needing one of its own: kubectl exec, npm run, cargo run, git checkout.

The worst case is git. With a branch and a file sharing a name,
'ahoy git checkout -- deploy' arrived as 'git checkout deploy', so a
request to discard edits to a file switched branch instead and left the
edits in place.

The strip came from #101, fixing #100 ('ahoy up -- --build' reaching
docker-compose as '-- --build'). The intent there was that a leading '--'
shields what follows, which urfave/cli needed at the time; the
implementation stripped every occurrence instead of the first. Since #182
ahoy no longer parses a command's arguments at all, so a leading '--' is
now only a readability habit, but scripts still use it and honouring it
costs nothing.

Now: a leading '--' is consumed, every later one is the command's data.

Claude-Session: https://claude.ai/code/session_01629NFuQxTr678Tdh8AD39d
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.

2 participants

⌂ 换网址