cloudflare / workers-sdk

⛅️ Home to Wrangler, the CLI for Cloudflare Workers®
https://developers.cloudflare.com/workers/
Apache License 2.0
2.42k stars 594 forks source link

bash/zsh completions #53

Open threepointone opened 2 years ago

threepointone commented 2 years ago

We can leverage yargs.completion() to autogenerate bash/zsh completions for wrangler. I tried it, and it's... fine. Annoyingly, it hijacks any suggestions for filenames, and I assume we'll have to reimplement that. Leaving this open if anyone wants a crack at it.

JacobMGEvans commented 2 years ago

yargs.completion stuff from what I can tell it seems the filename completion not working is fundamental issue with their script they generate for zsh (I use zsh) I was able to get completion to work for the main commands and then the filesystem to autocomplete after the command completions, however, it overrides the flags

I created a ticket on yargs, hopefully get some insight or a potential workaround with the .positional for filename https://github.com/yargs/yargs/issues/2113

threepointone commented 2 years ago

I don't think this is something we can work on now, it'll take a ton of work to get this to work well for us since yargs doesn't even list files etc. Should probably unassign and move this to backlog.

petebacondarwin commented 2 years ago

I agree. Moving to the backlog...

DaniFoldi commented 11 months ago

In case this gets picked up, could we have fish (https://fishshell.com) added to the list of supported shells?

RamIdeas commented 11 months ago

We won't be able to do anything about this until yargs/yargs#2113 is resolved but there's been no movement there. Closing for now.

Cherry commented 11 months ago

I don't think closing an issue because it's blocked upstream makes a lot of sense...

This is still something that would be good to have, and people want to see, and closing the issue is only going to cause confusion when someone searches for it later and sees it closed as "completed", or this can be addressed down the line. What's the harm in leaving it open and just adding a blocked label or something so it can be easily filtered? cc @admah

alyssadev commented 9 months ago

Completions would certainly be nice to have as a feature. The mentioned upstream blocking issue is implemented by yargs/yargs#2331, just hasn't been merged since May.

pauliesnug commented 8 months ago

Any update on this?

alyssadev commented 8 months ago

Blocked by upstream as mentioned

Lan-Hekary commented 2 months ago

Any news on this front ?

pauliesnug commented 3 weeks ago

Blocked by upstream as mentioned

@alyssadev We could do a pnpm patch or something similar, since its just a few LOC change?

alyssadev commented 3 weeks ago

Blocked by upstream as mentioned

@alyssadev We could do a pnpm patch or something similar, since its just a few LOC change?

I'm not involved in any way, I just wanted to help by indicating that there's an upstream issue that seems to be blocking.

pauliesnug commented 3 weeks ago

Oh I see sorry. I might make a PR with the patch!