| 1 |
//! Command-line parser for `sq pki vouch list`. |
| 2 |
|
| 3 |
use clap::Parser; |
| 4 |
|
| 5 |
use crate::cli::types::CertDesignators; |
| 6 |
use crate::cli::types::cert_designator; |
| 7 |
|
| 8 |
use crate::cli::examples::*; |
| 9 |
|
| 10 |
const LIST_EXAMPLES: Actions = Actions { |
| 11 |
actions: &[ |
| 12 |
Action::setup().command(&[ |
| 13 |
"sq", "key", "import", |
| 14 |
"alice-secret.pgp", |
| 15 |
]).build(), |
| 16 |
|
| 17 |
// Alice certifies that Bob controls |
| 18 |
// 511257EBBF077B7AEDAE5D093F68CB84CE537C9A and |
| 19 |
// [email protected]. |
| 20 |
Action::setup().command(&[ |
| 21 |
"sq", "pki", "vouch", "add", |
| 22 |
"--certifier=EB28F26E2739A4870ECC47726F0073F60FD0CBF0", |
| 23 |
"--cert=511257EBBF077B7AEDAE5D093F68CB84CE537C9A", |
| 24 |
"[email protected]", |
| 25 |
]).build(), |
| 26 |
|
| 27 |
Action::example().comment( |
| 28 |
"List certifications made by Alice.", |
| 29 |
).command(&[ |
| 30 |
"sq", "pki", "vouch", "list", |
| 31 |
"--certifier=EB28F26E2739A4870ECC47726F0073F60FD0CBF0" |
| 32 |
]).build(), |
| 33 |
|
| 34 |
Action::example().comment( |
| 35 |
"List certifications made by Alice for Bob's certificate.", |
| 36 |
).command(&[ |
| 37 |
"sq", "pki", "vouch", "list", |
| 38 |
"--certifier=EB28F26E2739A4870ECC47726F0073F60FD0CBF0", |
| 39 |
"--cert=511257EBBF077B7AEDAE5D093F68CB84CE537C9A", |
| 40 |
]).build(), |
| 41 |
], |
| 42 |
}; |
| 43 |
test_examples!(sq_pki_vouch_list, LIST_EXAMPLES); |
| 44 |
|
| 45 |
#[derive(Parser, Debug)] |
| 46 |
#[clap( |
| 47 |
name = "list", |
| 48 |
about = "List certifications", |
| 49 |
long_about = "\ |
| 50 |
List certifications |
| 51 |
|
| 52 |
If the certifier argument is provided, then certifications made by the \ |
| 53 |
specified certificate are shown. If the certificate argument is \ |
| 54 |
provided, then certifications of the specified certificate are shown. \ |
| 55 |
If both are provided, then certifications of the specified certificate \ |
| 56 |
made by the specified certifier are shown. |
| 57 |
|
| 58 |
This command lists all of certifications, not just the active \ |
| 59 |
certification. |
| 60 |
|
| 61 |
Because certifications are associated with the certificated \ |
| 62 |
certificate and not the certifier's certificate, this list is likely \ |
| 63 |
incomplete. |
| 64 |
|
| 65 |
Stable since 1.2.0. |
| 66 |
", |
| 67 |
after_help = LIST_EXAMPLES, |
| 68 |
)] |
| 69 |
pub struct Command { |
| 70 |
#[command(flatten)] |
| 71 |
pub certifier: CertDesignators<cert_designator::CertUserIDEmailFileSelfSpecialArgs, |
| 72 |
cert_designator::CertifierPrefix, |
| 73 |
cert_designator::OneOptionalValue>, |
| 74 |
|
| 75 |
#[command(flatten)] |
| 76 |
pub cert: CertDesignators<cert_designator::CertUserIDEmailFileArgs, |
| 77 |
cert_designator::CertPrefix, |
| 78 |
cert_designator::OneOptionalValue>, |
| 79 |
} |