| 1 |
use clap::ArgMatches; |
| 2 |
|
| 3 |
use sequoia_openpgp as openpgp; |
| 4 |
use openpgp::Result; |
| 5 |
|
| 6 |
use crate::cli::pki::vouch; |
| 7 |
use crate::Sq; |
| 8 |
|
| 9 |
pub mod authorize; |
| 10 |
pub mod add; |
| 11 |
pub mod list; |
| 12 |
pub mod replay; |
| 13 |
|
| 14 |
pub fn vouch(sq: Sq, c: vouch::Command, matches: &ArgMatches) -> Result<()> { |
| 15 |
use vouch::Subcommands::*; |
| 16 |
let matches = matches.subcommand().unwrap().1; |
| 17 |
|
| 18 |
match c.subcommand { |
| 19 |
Add(mut c) => { |
| 20 |
c.expiration_source = matches.value_source("expiration"); |
| 21 |
add::add(sq, c) |
| 22 |
}, |
| 23 |
Authorize(mut c) => { |
| 24 |
c.expiration_source = matches.value_source("expiration"); |
| 25 |
authorize::authorize(sq, c) |
| 26 |
}, |
| 27 |
List(c) => { |
| 28 |
list::list(sq, c) |
| 29 |
}, |
| 30 |
Replay(c) => { |
| 31 |
replay::replay(sq, c) |
| 32 |
}, |
| 33 |
} |
| 34 |
} |