Debian Codegraph @

src/cli/key/import.rs

raw
1 //! Command-line parser for `sq key import`.
2
3 use std::path::PathBuf;
4
5 use clap::Args;
6
7 use crate::cli::examples::*;
8
9 #[derive(Debug, Args)]
10 #[clap(
11 about = "Import keys into the key store",
12 after_help = IMPORT_EXAMPLES,
13 )]
14 pub struct Command {
15 #[clap(
16 value_name = "KEY_FILE",
17 help = "Read from KEY_FILE or stdin if omitted",
18 )]
19 pub input: Vec<PathBuf>,
20 }
21
22 const IMPORT_EXAMPLES: Actions = Actions {
23 actions: &[
24 Action::example().comment("\
25 Import the keys into the key store."
26 ).command(&[
27 "sq", "key", "import", "alice-secret.pgp",
28 ]).build(),
29 ]
30 };
31 test_examples!(sq_key_import, IMPORT_EXAMPLES);