fork/fish-shell

git clone https://git.julia.blue/fork/fish-shell

Johannes Altmanningercompletions/signify: consistent style1c3403825

master
2.8 KiB78 linesraw
1# Tab completion for openbsd-signify
2
3set -l subcommands -C -G -S -V
4set -l subcommands_desc (echo -s \
5    -C\t"Verify a signed checksum list."\n \
6    -G\t"Generate a new key pair."\n \
7    -S\t"Sign the specified message file."\n \
8    -V\t"Verify the message and signature match."\n \
9    | string escape)
10
11complete -c signify -f
12
13complete -c signify \
14    -n "not __fish_seen_subcommand_from $subcommands" \
15    -a "$subcommands_desc"
16
17complete -c signify -F \
18    -n '__fish_seen_subcommand_from -C'
19
20complete -c signify -s c -f -r \
21    -d 'Specify the comment to be added during key generation' \
22    -n '__fish_seen_subcommand_from -G'
23
24complete -c signify -s e -f \
25    -d 'Use embedded signatures' \
26    -n '__fish_seen_subcommand_from -S -V'
27
28complete -c signify -s m -F -r \
29    -d 'Message file to sign or verify' \
30    -n '__fish_seen_subcommand_from -S -V'
31
32# The -n option has two context-dependent meanings
33complete -c signify -s n -f \
34    -d 'When generating a key pair, do not ask for a passphrase' \
35    -n '__fish_seen_argument -s G'
36complete -c signify -s n -f \
37    -d 'When signing with -z, store a zero timestamp in the gzip header' \
38    -n '__fish_seen_subcommand_from -S && __fish_seen_argument -s z'
39
40# This is deliberately split up to only add a description to the flag and not all its argument completions
41complete -c signify -s p -f -k -r \
42    -a '(__fish_complete_suffix .pub)' \
43    -n '__fish_seen_subcommand_from -C -G -V'
44complete -c signify -s p -f -k -r \
45    -d 'Public key produced by -G, and used by -V to check a signature' \
46    -n '__fish_seen_subcommand_from -C -G -V'
47
48complete -c signify -s q -f \
49    -d 'Quiet mode.  Suppress informational output' \
50    -n '__fish_seen_subcommand_from -C -V'
51
52complete -c signify -s s -f -k -r \
53    -a '(__fish_complete_suffix .sec)' \
54    -n '__fish_seen_subcommand_from -G -S'
55complete -c signify -s s -f -k -r \
56    -d 'Secret (private) key produced by -G, and used by -S to sign a message' \
57    -n '__fish_seen_subcommand_from -G -S'
58
59complete -c signify -s t -f -r \
60    -a '(
61        set -l files /etc/signify/*
62        string replace -rf -- \'\\.pub$\' "" $files | string replace -r \'.*-\' ""
63    )' \
64    -n '__fish_seen_subcommand_from -C -V'
65complete -c signify -s t -f -r \
66    -d 'When inferring a key to verify with, only use keys with this keytype suffix' \
67    -n '__fish_seen_subcommand_from -C -V'
68
69complete -c signify -s x -f -k -r \
70    -a '(__fish_complete_suffix .sig)' \
71    -n '__fish_seen_subcommand_from -C -S -V'
72complete -c signify -s x -f -k -r \
73    -d 'The signature file to create or verify. The default is message.sig' \
74    -n '__fish_seen_subcommand_from -C -S -V'
75
76complete -c signify -s z -f \
77    -d 'Sign and verify gzip (1) archives, embed signature in the header' \
78    -n '__fish_seen_subcommand_from -S -V'