-
Notifications
You must be signed in to change notification settings - Fork 13
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
zsh completion is broken #57
Comments
@jmcantrell this is clap bug , checkout here |
Clap has now fixed the underlying issue and also just made a new release. Bumping the version of clap to v4.1.8 could fix this issue then. |
@jmcantrell @almazgaliev @zUnixorn I updated clap in #78. Does this fix the issue? |
@oberblastmeister I only tested zsh, but I replaced |
I've been digging through this project's code and clap's for a bit and I'm thinking that this might not be a solvable problem on clap's end. The way trashy is using the parser now (as I understand it) is that it's flattening the main commands args into the parser along with the put command's args, both of those sets of args expect varying number of trailing arguments. The main command is looking for 0 or 1 command names whereas the put command is looking for 0 or more paths. Zsh, and I'm pretty sure the other supported shells, do not support this, which means that there will not be a way to generate a correct completion script. I'm looking at the git example in clap's docs (https://docs.rs/clap/latest/clap/_derive/_cookbook/git_derive/index.html) to see how they handle this case (git stash, where push is the default command). |
I wonder if we should just drop the optional command, and just do |
Personally, that's the interface I want, and if this were a brand new project it would be what I would push for. The only reason I didn't suggest it is because it's a breaking change, and it's one of the features mentioned in the readme. |
+1 to this problem. I'm getting the error when trying to use tab completion, regardless of whether I use the command Steps to reproduceType Expected resultTab completion should show the files and folders in current directory. Actual resultThe following error is displayed:
Additional infoOS: NixOS |
Sounds very reasonable. Any existing script that relies on As for interactive use, typing |
Just some user feedback, I would personally not mind at all if the subcommand was made necessary. I noticed the help/manpage generation is a bit confusing at the moment: Help:
Manpage:
Notice how the |
Unfortunately completion still doesn't seem to work when |
When completing with any input on zsh, all I get is the following error:
I'm using the aur version on arch.
The text was updated successfully, but these errors were encountered: