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
Completions for restic not loading #8177
Comments
This is a quite awkward completion script, and does a few very unorthodox and very much not recommended things. For instance:
Basically it's a very direct translation of the bash/zsh completions, made for parity, instead of working with fish's system. There's a bunch of debugging stuff in there if you set $BASH_COMP_DEBUG_FILE (yes, that's "BASH"). So: But you probably want to talk to upstream, as I don't have restic. |
E.g. this part: # Since Fish completions are only loaded once the user triggers them, we trigger them ourselves
# so we can properly delete any completions provided by another script. Is entirely wrong in every way. One, you don't want to erase the completions, two: they are already being loaded. That's how you get into this file. |
Okay, the fish completion generation was enabled in restic/restic@9cc1ecd, committed after the last release, so I don't believe it's available in a release yet. I tested with your file and restic 0.12.0, and it does indeed try to execute
So... unless you're testing restic from git, it's simply not available yet. Other than that, the completions are generated by https://github.com/spf13/cobra, so if you have problems with these, you should ask there. |
Thank you for looking into it. I'm a restic end user and not familiar with the internal workings of either fish or restic, so I can't fix the completion script. I got the completion script from the restic forums since my distro's version of restic didn't have the generation feature for fish (as you point out). I'll wait for the Arch repos to get the latest version of restic, then raise an issue over at restic with reference to this thread for your suggestions on improving the completions script. |
Yeah cobra generates fairly non-idiomatic completions, because they try to make fish behave like other shells. |
The CLI backup program restic can generate a fish-completions file, as described here. The generated file is here.
I saved this file as
~/.config/fish/completions/restic.fish
and also ransource restic.fish
, which did not report any errors.However I'm not getting any completions, either of subcommands (restic mount, restic backup etc), or of command line options. Am I missing any steps?
The text was updated successfully, but these errors were encountered: