diff options
author | Nora Widdecke <nora@sequoia-pgp.org> | 2022-06-02 10:24:11 +0200 |
---|---|---|
committer | Nora Widdecke <nora@sequoia-pgp.org> | 2022-06-08 14:49:43 +0200 |
commit | 0ba72d67d162baa838cadad18be49751decff969 (patch) | |
tree | 853b4042a4a48c08fb1125a033d3c2aa9fc93392 | |
parent | 8f361c37704194914d3f095050e1c8b7d51cb3bd (diff) |
sq: Adapt dearmor command to clap3's derive style.
- This is part of the effort of moving to clap3's derive API and
profit from the added type safety.
-rw-r--r-- | sq/src/sq.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sq/src/sq.rs b/sq/src/sq.rs index ae3a8cd1..eba6a771 100644 --- a/sq/src/sq.rs +++ b/sq/src/sq.rs @@ -628,9 +628,12 @@ fn main() -> Result<()> { output.finalize()?; }, Some(("dearmor", m)) => { - let mut input = open_or_stdin(m.value_of("input"))?; + use clap::FromArgMatches; + let command = sq_cli::DearmorCommand::from_arg_matches(m)?; + + let mut input = open_or_stdin(command.input.as_deref())?; let mut output = - config.create_or_stdout_safe(m.value_of("output"))?; + config.create_or_stdout_safe(command.output.as_deref())?; let mut filter = armor::Reader::from_reader(&mut input, None); io::copy(&mut filter, &mut output)?; }, |