diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2019-09-09 16:39:28 +0200 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2019-09-09 17:00:59 +0200 |
commit | 59fdd99b635635f4887a49361a754291dabc2ac7 (patch) | |
tree | d4ac5850f5ef8832045d8d7ef747699a872a436b /tool | |
parent | 5fd621f485bb43cb0f81b2fcfc0bcf834ddc7893 (diff) |
net: Introduce enum wkd::Variant.
Diffstat (limited to 'tool')
-rw-r--r-- | tool/src/sq.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tool/src/sq.rs b/tool/src/sq.rs index 2200dbb1..bfdaedab 100644 --- a/tool/src/sq.rs +++ b/tool/src/sq.rs @@ -551,14 +551,18 @@ fn real_main() -> Result<(), failure::Error> { // XXX: is a bad idea to use this default dir? let base_path = m.value_of("output") .unwrap_or("/var/www/html"); - let direct_method = m.is_present("direct_method"); + let variant = if m.is_present("direct_method") { + wkd::Variant::Direct + } else { + wkd::Variant::Advanced + }; let mut buffer: Vec<u8> = Vec::new(); f.read_to_end(&mut buffer)?; let parser = TPKParser::from_bytes(&buffer)?; let tpks: Vec<TPK> = parser.filter_map(|tpk| tpk.ok()) .collect(); for tpk in tpks { - wkd::insert(&base_path, domain, direct_method, &tpk) + wkd::insert(&base_path, domain, variant, &tpk) .context(format!("Failed to generate the WKD in \ {}.", base_path))?; } |