New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: ensure completion script uses valid function name #2388
base: main
Are you sure you want to change the base?
fix: ensure completion script uses valid function name #2388
Conversation
Anything else you need for this? |
Is there anything I can do to push this over the line? |
Ok, my main problem is I am dubious this is useful in practice. Working with command names with spaces in them is pretty clunky and I have never seen it being used. I need convincing that users will benefit from this before I give it a positive review. (I don't think completion will work through a yarn run script, but haven't tried that scenario mentioned in the issue.) My secondary concern is whether it even works. I had another look. The current PR completion does not seem to be functional for a script name with a space as the
I wrote out the completion and edited it to have:
And could then get completion for
|
Its in every npm script that ends up calling out out to yargs. And I'm using it in the MetaMask extension, er, I want to use it in MetaMask but can't without quite a bit of customization because the generated completion script isn't valid. I've been editing the minified code, so sorry my PR doesn't even work 😢 Looks like zhs just needs single quotes around commands with spaces. But bash needs a bit more work, as it doesn't work even when quoted. The bash version would be something like:
It sounds like even if I got it working you wouldn't want this, correct? |
This might be where I am missing something. How does this involve a command name with a space in it? I'll explain what I am thinking. So in my head, I have an npm run-script called Where does completion come into it? I don't think the user will be able to get completion on (One step simpler with yarn if can omit the |
This sounds like you do have a concrete plan! What does the help show, and what is user typing on command-line when completion works? Or is the completion used in a non-interactive way by some higher level tooling? |
(I am not expert in completion handlers, and my mental model of one handler per command might be preventing me seeing the goal.) |
(Oh, multi-word completion handlers, that rings a vague bell...) |
Fixes #2387