Generating mach completion had a quote error
Categories
(Firefox Build System :: Mach Core, defect)
Tracking
(firefox89 fixed)
Tracking | Status | |
---|---|---|
firefox89 | --- | fixed |
People
(Reporter: tjr, Assigned: ahal)
Details
Attachments
(1 file)
When I generated mach completion for zsh (oh-my-zsh if it matters), it had the following line:
opts+=("--locales:List of locales to package, including \"en-US\" "--verbose:Log informative status messages.")
It should have been
opts+=("--locales:List of locales to package, including \"en-US\"" "--verbose:Log informative status messages.")
(two "'s after en-US)
This caused shell errors.
Assignee | ||
Comment 1•4 years ago
•
|
||
Interesting, when I generate it I get:
opts+=("--locales:List of locales to package, including \\\"en-US\\\" "--verbose:Log informative status messages.")
(edit: I see you get this too, it's just markdown removing some of the slashes)
and completion works just fine. If I add a second quote then I get errors. I don't think it would matter, but I'm not using oh-my-zsh. Also I'm on zsh 5.8. I'm definitely not a shell guru, writing these completion scripts were a new experience for me. So I don't know what could be going on here, though here's where the options get generated:
https://searchfox.org/mozilla-central/rev/bb37e6fe8bbe383a57a4ad21a201e26416613ca1/python/mach/mach/commands/commandinfo.py#332
If there's a bug, it's likely in the _zsh_describe
function:
https://searchfox.org/mozilla-central/rev/bb37e6fe8bbe383a57a4ad21a201e26416613ca1/python/mach/mach/commands/commandinfo.py#206
Which I borrowed from elsewhere.
Assignee | ||
Comment 2•4 years ago
|
||
Although it looks like I can't tab complete the options for package-multi-locales
, nor the commands preceding it like package
. So maybe there's another missing quote and it just happens to parse under my version of zsh? Bizarre.
Assignee | ||
Comment 3•4 years ago
|
||
Ah, I found the bug. This strip call removes all quotes at the end or beginning of the description. So if the description begins or ends with an escaped quote, it'll be removed as well. I'm not sure why this didn't cause failures for me, maybe I have a more permissive mode enabled or something.
Assignee | ||
Comment 4•4 years ago
|
||
We want to make sure to only strip a single leading or trailing quote, and
not all of them.
Comment 6•4 years ago
|
||
bugherder |
Description
•