-
Notifications
You must be signed in to change notification settings - Fork 202
Fix RootHelper
parse logic to support options with an equal (e.g.: option=value
)
#2092
Conversation
RootHelper
parse logic to support options with an equal (e.g option=value
)RootHelper
parse logic to support options with an equal (e.g.: option=value
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hum, I'm not sure I understand the purpose of RootHelper
, shouldn't https://ruby-doc.org/stdlib-2.7.1/libdoc/optparse/rdoc/OptionParser.html handle all of this for us? I think we're already using it for parsing too.
Thanks for the review, @macournoyer! Ideally, yes, However, it doesn't support glob parameters (essential for $ shopify theme push -d --only layout/*
# args: ["layout/theme.liquid"]
# flags: {:development=>true, :only=>["layout/password.liquid"]} Before the Given the impact of this fix, I'm proceeding with the merge. But, please, let me know if you'd like to revisit it when you're back, @macournoyer! :) Thanks again for the review! 🚀 |
But I might not be understanding this correctly. My only concern is: are we working against the shell? I can't think of any other CLI where something like |
Thanks for reviewing this PR and sharing your thoughts, @macournoyer :) I agree that other CLI tools (as However, considering the scenario above (reported by a partner), it seems a bit unexpected that the CLI was adopting the So, considering the pros and cons on both sides, it seems fair to support parameters without quotes to provide a better DX for partners that are not familiar with this kind of scenario. Still, I'm not sure if we're missing any thread-offs or limitations in this direction. Do you have thoughts about that? |
But don't you think it's more confusing if we chose a different approach than most CLIs? It's only unexpected by people who are not aware of how shell expansion works. If a partner is confused about it, I think we should educate, instead of working around it. Here's how
|
WHY are these changes introduced?
Users may successfully run
shopify-dev theme serve --live-reload off
. However, they face an error when they try to runshopify-dev theme serve --live-reload=off
.WHAT is this pull request doing?
This PR slightly changes the
RootHelper
parse logic to support flags with anequal
character between the option key and value.How to test your changes?
shopify theme serve --live-reload=off
Before this PR:
After this PR:
Post-release steps
None.
Update checklist