clap icon indicating copy to clipboard operation
clap copied to clipboard

Syntax error when attempt ZSH completion for `ValueEnum` variants

Open KSXGitHub opened this issue 1 year ago • 0 comments

Notes

This bug is very specific to my application that I haven't managed to create a minimal reproducible code yet. So instead, I'll be providing links to my application.

Please complete the following tasks

Rust Version

1.62.1

Clap Version

3.2.16

Minimal reproducible code

N/A

Steps to reproduce

  1. Create an executable at /usr/bin/pdu. Or alternatively, install pdu.
  2. Download and install the zsh completions for pdu at /usr/share/zsh/site-functions/_pdu (this file was generated by ./generate-completion.sh).
  3. Open ZSH login shell, type pdu --bytes-format= and then press Tab.

Actual Behaviour

The following error appears:

(eval):2: unmatched "
_arguments:465: command not found: (
(eval):2: unmatched "
_arguments:465: command not found: (
(eval):2: unmatched "
_arguments:465: command not found: (

Expected Behaviour

A completion menu of plain, metric, and binary should appear to let user choose.

Additional Context

  • ZSH version: 5.9
  • OS: Arch Linux
  • The Args struct: https://github.com/KSXGitHub/parallel-disk-usage/blob/0.8.2/src/args.rs
  • The completion generator: https://github.com/KSXGitHub/parallel-disk-usage/blob/0.8.2/cli/completions.rs

If you have an Arch Linux machine, you can also install the AUR package (bin version).

Debug Output

No response

KSXGitHub avatar Aug 10 '22 07:08 KSXGitHub