Package: src:elvish
Version: 0.15.0~rc3-1
Control: affects -1 src:rust-sequoia-sq src:rust-sequoia-sqv

I'm packaging a few rust binaries built using the "clap" crate, which
auto-generates completion files for bash, fish, zsh, elvish, and
powershell.

I know how to ship the bash, fish, and zsh tab completion directives.
But i don't know how to ship the elvish tab completion directives, or
how to test that they work as expected.  i'm including an example sq.elv
that is produced by the rust-sequoia-sq package when it's built, for
reference.

It would be great if we could document in the elvish source package
debian/ directory at least (or even better, in the binary package, in
/usr/share/doc/elvish).

If it's already documented someplace and i'm just unaware, feel free to
close this report with a pointer to the right location!

Thanks for maintaining elvish in debian!

       --dkg

edit:completion:arg-completer[sq] = [@words]{
    fn spaces [n]{
        repeat $n ' ' | joins ''
    }
    fn cand [text desc]{
        edit:complex-candidate $text &display-suffix=' '(spaces (- 14 (wcswidth 
$text)))$desc
    }
    command = 'sq'
    for word $words[1:-1] {
        if (has-prefix $word '-') {
            break
        }
        command = $command';'$word
    }
    completions = [
        &'sq'= {
            cand --known-notation 'Adds NOTATION to the list of known notations'
            cand -f 'Overwrites existing files'
            cand --force 'Overwrites existing files'
            cand -h 'Prints help information'
            cand --help 'Prints help information'
            cand -V 'Prints version information'
            cand --version 'Prints version information'
            cand decrypt 'Decrypts a message'
            cand encrypt 'Encrypts a message'
            cand sign 'Signs messages or data files'
            cand verify 'Verifies signed messages or detached signatures'
            cand armor 'Converts binary to ASCII'
            cand dearmor 'Converts ASCII to binary'
            cand inspect 'Inspects data, like file(1)'
            cand key 'Manages keys'
            cand keyring 'Manages collections of keys or certs'
            cand certify 'Certifies a User ID for a Certificate'
            cand packet 'Low-level packet manipulation'
            cand help 'Prints this message or the help of the given 
subcommand(s)'
        }
        &'sq;decrypt'= {
            cand -o 'Writes to FILE or stdout if omitted'
            cand --output 'Writes to FILE or stdout if omitted'
            cand -n 'Sets the threshold of valid signatures to N'
            cand --signatures 'Sets the threshold of valid signatures to N'
            cand --signer-cert 'Verifies signatures with CERT'
            cand --recipient-key 'Decrypts with KEY'
            cand --dump-session-key 'Prints the session key to stderr'
            cand --dump 'Prints a packet dump to stderr'
            cand -x 'Prints a hexdump (implies --dump)'
            cand --hex 'Prints a hexdump (implies --dump)'
            cand -h 'Prints help information'
            cand --help 'Prints help information'
            cand -V 'Prints version information'
            cand --version 'Prints version information'
        }
        &'sq;encrypt'= {
            cand -o 'Writes to FILE or stdout if omitted'
            cand --output 'Writes to FILE or stdout if omitted'
            cand --recipient-cert 'Encrypts for all recipients in CERT-RING'
            cand --signer-key 'Signs the message with KEY'
            cand --mode 'Selects what kind of keys are considered for 
encryption.'
            cand --compression 'Selects compression scheme to use'
            cand -t 'Chooses keys valid at the specified time and sets the 
signature''s creation time'
            cand --time 'Chooses keys valid at the specified time and sets the 
signature''s creation time'
            cand -B 'Emits binary data'
            cand --binary 'Emits binary data'
            cand -s 'Adds a password to encrypt with'
            cand --symmetric 'Adds a password to encrypt with'
            cand --use-expired-subkey 'Falls back to expired encryption subkeys'
            cand -h 'Prints help information'
            cand --help 'Prints help information'
            cand -V 'Prints version information'
            cand --version 'Prints version information'
        }
        &'sq;sign'= {
            cand -o 'Writes to FILE or stdout if omitted'
            cand --output 'Writes to FILE or stdout if omitted'
            cand --merge 'Merges signatures from the input and SIGNED-MESSAGE'
            cand --signer-key 'Signs using KEY'
            cand -t 'Chooses keys valid at the specified time and sets the 
signature''s creation time'
            cand --time 'Chooses keys valid at the specified time and sets the 
signature''s creation time'
            cand --notation 'Adds a notation to the certification.'
            cand -B 'Emits binary data'
            cand --binary 'Emits binary data'
            cand --detached 'Creates a detached signature'
            cand -a 'Appends a signature to existing signature'
            cand --append 'Appends a signature to existing signature'
            cand -n 'Signs a message and all existing signatures'
            cand --notarize 'Signs a message and all existing signatures'
            cand -h 'Prints help information'
            cand --help 'Prints help information'
            cand -V 'Prints version information'
            cand --version 'Prints version information'
        }
        &'sq;verify'= {
            cand -o 'Writes to FILE or stdout if omitted'
            cand --output 'Writes to FILE or stdout if omitted'
            cand --detached 'Verifies a detached signature'
            cand -n 'Sets the threshold of valid signatures to N'
            cand --signatures 'Sets the threshold of valid signatures to N'
            cand --signer-cert 'Verifies signatures with CERT'
            cand -h 'Prints help information'
            cand --help 'Prints help information'
            cand -V 'Prints version information'
            cand --version 'Prints version information'
        }
        &'sq;armor'= {
            cand -o 'Writes to FILE or stdout if omitted'
            cand --output 'Writes to FILE or stdout if omitted'
            cand --label 'Selects the kind of armor header'
            cand -h 'Prints help information'
            cand --help 'Prints help information'
            cand -V 'Prints version information'
            cand --version 'Prints version information'
        }
        &'sq;dearmor'= {
            cand -o 'Writes to FILE or stdout if omitted'
            cand --output 'Writes to FILE or stdout if omitted'
            cand -h 'Prints help information'
            cand --help 'Prints help information'
            cand -V 'Prints version information'
            cand --version 'Prints version information'
        }
        &'sq;inspect'= {
            cand --certifications 'Prints third-party certifications'
            cand -h 'Prints help information'
            cand --help 'Prints help information'
            cand -V 'Prints version information'
            cand --version 'Prints version information'
        }
        &'sq;key'= {
            cand -h 'Prints help information'
            cand --help 'Prints help information'
            cand -V 'Prints version information'
            cand --version 'Prints version information'
            cand generate 'Generates a new key'
            cand extract-cert 'Converts a key to a cert'
            cand adopt 'Binds keys from one certificate to another'
            cand attest-certifications 'Attests to third-party certifications'
            cand help 'Prints this message or the help of the given 
subcommand(s)'
        }
        &'sq;key;generate'= {
            cand -u 'Adds a userid to the key'
            cand --userid 'Adds a userid to the key'
            cand -c 'Selects the cryptographic algorithms for the key'
            cand --cipher-suite 'Selects the cryptographic algorithms for the 
key'
            cand --expires 'Makes the key expire at TIME (as ISO 8601)'
            cand --expires-in 'Makes the key expire after DURATION (as N[ymwd]) 
[default: 3y]'
            cand --can-encrypt 'Adds an encryption-capable subkey [default: 
universal]'
            cand -e 'Writes the key to OUTFILE'
            cand --export 'Writes the key to OUTFILE'
            cand --rev-cert 'Writes the revocation certificate to FILE'
            cand --with-password 'Protects the key with a password'
            cand --can-sign 'Adds a signing-capable subkey (default)'
            cand --cannot-sign 'Adds no signing-capable subkey'
            cand --cannot-encrypt 'Adds no encryption-capable subkey'
            cand -h 'Prints help information'
            cand --help 'Prints help information'
            cand -V 'Prints version information'
            cand --version 'Prints version information'
        }
        &'sq;key;extract-cert'= {
            cand -o 'Writes to FILE or stdout if omitted'
            cand --output 'Writes to FILE or stdout if omitted'
            cand -B 'Emits binary data'
            cand --binary 'Emits binary data'
            cand -h 'Prints help information'
            cand --help 'Prints help information'
            cand -V 'Prints version information'
            cand --version 'Prints version information'
        }
        &'sq;key;adopt'= {
            cand -r 'Supplies keys for use in --key.'
            cand --keyring 'Supplies keys for use in --key.'
            cand -k 'Adds the key or subkey KEY to the TARGET-KEY'
            cand --key 'Adds the key or subkey KEY to the TARGET-KEY'
            cand -o 'Writes to FILE or stdout if omitted'
            cand --output 'Writes to FILE or stdout if omitted'
            cand --allow-broken-crypto 'Allows adopting keys from certificates 
using broken cryptography'
            cand -B 'Emits binary data'
            cand --binary 'Emits binary data'
            cand -h 'Prints help information'
            cand --help 'Prints help information'
            cand -V 'Prints version information'
            cand --version 'Prints version information'
        }
        &'sq;key;attest-certifications'= {
            cand -o 'Writes to FILE or stdout if omitted'
            cand --output 'Writes to FILE or stdout if omitted'
            cand --none 'Removes all prior attestations'
            cand --all 'Attests to all certifications [default]'
            cand -B 'Emits binary data'
            cand --binary 'Emits binary data'
            cand -h 'Prints help information'
            cand --help 'Prints help information'
            cand -V 'Prints version information'
            cand --version 'Prints version information'
        }
        &'sq;key;help'= {
            cand -h 'Prints help information'
            cand --help 'Prints help information'
            cand -V 'Prints version information'
            cand --version 'Prints version information'
        }
        &'sq;keyring'= {
            cand -h 'Prints help information'
            cand --help 'Prints help information'
            cand -V 'Prints version information'
            cand --version 'Prints version information'
            cand filter 'Joins keys into a keyring applying a filter'
            cand join 'Joins keys or keyrings into a single keyring'
            cand merge 'Merges keys or keyrings into a single keyring'
            cand list 'Lists keys in a keyring'
            cand split 'Splits a keyring into individual keys'
            cand help 'Prints this message or the help of the given 
subcommand(s)'
        }
        &'sq;keyring;filter'= {
            cand -o 'Writes to FILE or stdout if omitted'
            cand --output 'Writes to FILE or stdout if omitted'
            cand --name 'Matches on NAME'
            cand --email 'Matches on email ADDRESS'
            cand --domain 'Matches on email domain FQDN'
            cand -P 'Removes certificate components not matching the filter'
            cand --prune-certs 'Removes certificate components not matching the 
filter'
            cand -B 'Emits binary data'
            cand --binary 'Emits binary data'
            cand --to-cert 'Converts any keys in the input to certificates.  
Converting a key to a certificate removes secret key material from the key 
thereby turning it into a certificate.'
            cand -h 'Prints help information'
            cand --help 'Prints help information'
            cand -V 'Prints version information'
            cand --version 'Prints version information'
        }
        &'sq;keyring;join'= {
            cand -o 'Sets the output file to use'
            cand --output 'Sets the output file to use'
            cand -B 'Don''t ASCII-armor the keyring'
            cand --binary 'Don''t ASCII-armor the keyring'
            cand -h 'Prints help information'
            cand --help 'Prints help information'
            cand -V 'Prints version information'
            cand --version 'Prints version information'
        }
        &'sq;keyring;merge'= {
            cand -o 'Writes to FILE or stdout if omitted'
            cand --output 'Writes to FILE or stdout if omitted'
            cand -B 'Emits binary data'
            cand --binary 'Emits binary data'
            cand -h 'Prints help information'
            cand --help 'Prints help information'
            cand -V 'Prints version information'
            cand --version 'Prints version information'
        }
        &'sq;keyring;list'= {
            cand -h 'Prints help information'
            cand --help 'Prints help information'
            cand -V 'Prints version information'
            cand --version 'Prints version information'
        }
        &'sq;keyring;split'= {
            cand -p 'Writes to files with prefix FILE [defaults to the input 
filename with a dash, or "output" if keyring is read from stdin]'
            cand --prefix 'Writes to files with prefix FILE [defaults to the 
input filename with a dash, or "output" if keyring is read from stdin]'
            cand -B 'Emits binary data'
            cand --binary 'Emits binary data'
            cand -h 'Prints help information'
            cand --help 'Prints help information'
            cand -V 'Prints version information'
            cand --version 'Prints version information'
        }
        &'sq;keyring;help'= {
            cand -h 'Prints help information'
            cand --help 'Prints help information'
            cand -V 'Prints version information'
            cand --version 'Prints version information'
        }
        &'sq;certify'= {
            cand -o 'Writes to FILE or stdout if omitted'
            cand --output 'Writes to FILE or stdout if omitted'
            cand -d 'Sets the trust depth'
            cand --depth 'Sets the trust depth'
            cand -a 'Sets the amount of trust'
            cand --amount 'Sets the amount of trust'
            cand -r 'Adds a regular expression to constrain what a trusted 
introducer can certify'
            cand --regex 'Adds a regular expression to constrain what a trusted 
introducer can certify'
            cand --notation 'Adds a notation to the certification.'
            cand --expires 'Makes the certification expire at TIME (as ISO 
8601)'
            cand --expires-in 'Makes the certification expire after DURATION 
(as N[ymwd]) [default: 5y]'
            cand -B 'Emits binary data'
            cand --binary 'Emits binary data'
            cand -l 'Makes the certification a local certification'
            cand --local 'Makes the certification a local certification'
            cand --non-revocable 'Marks the certification as being 
non-revocable'
            cand -h 'Prints help information'
            cand --help 'Prints help information'
            cand -V 'Prints version information'
            cand --version 'Prints version information'
        }
        &'sq;packet'= {
            cand -h 'Prints help information'
            cand --help 'Prints help information'
            cand -V 'Prints version information'
            cand --version 'Prints version information'
            cand dump 'Lists packets'
            cand decrypt 'Unwraps an encryption container'
            cand split 'Splits a message into packets'
            cand join 'Joins packets split across files'
            cand help 'Prints this message or the help of the given 
subcommand(s)'
        }
        &'sq;packet;dump'= {
            cand -o 'Writes to FILE or stdout if omitted'
            cand --output 'Writes to FILE or stdout if omitted'
            cand --session-key 'Decrypts an encrypted message using SESSION-KEY'
            cand --mpis 'Prints cryptographic artifacts'
            cand -x 'Prints a hexdump'
            cand --hex 'Prints a hexdump'
            cand -h 'Prints help information'
            cand --help 'Prints help information'
            cand -V 'Prints version information'
            cand --version 'Prints version information'
        }
        &'sq;packet;decrypt'= {
            cand -o 'Writes to FILE or stdout if omitted'
            cand --output 'Writes to FILE or stdout if omitted'
            cand --recipient-key 'Decrypts the message with KEY'
            cand -B 'Emits binary data'
            cand --binary 'Emits binary data'
            cand --dump-session-key 'Prints the session key to stderr'
            cand -h 'Prints help information'
            cand --help 'Prints help information'
            cand -V 'Prints version information'
            cand --version 'Prints version information'
        }
        &'sq;packet;split'= {
            cand -p 'Writes to files with PREFIX [defaults: FILE a dash, or 
"output" if read from stdin)'
            cand --prefix 'Writes to files with PREFIX [defaults: FILE a dash, 
or "output" if read from stdin)'
            cand -h 'Prints help information'
            cand --help 'Prints help information'
            cand -V 'Prints version information'
            cand --version 'Prints version information'
        }
        &'sq;packet;join'= {
            cand -o 'Writes to FILE or stdout if omitted'
            cand --output 'Writes to FILE or stdout if omitted'
            cand --label 'Selects the kind of armor header'
            cand -B 'Emits binary data'
            cand --binary 'Emits binary data'
            cand -h 'Prints help information'
            cand --help 'Prints help information'
            cand -V 'Prints version information'
            cand --version 'Prints version information'
        }
        &'sq;packet;help'= {
            cand -h 'Prints help information'
            cand --help 'Prints help information'
            cand -V 'Prints version information'
            cand --version 'Prints version information'
        }
        &'sq;help'= {
            cand -h 'Prints help information'
            cand --help 'Prints help information'
            cand -V 'Prints version information'
            cand --version 'Prints version information'
        }
    ]
    $completions[$command]
}

Attachment: signature.asc
Description: PGP signature

Reply via email to