Debian Codegraph @

src/cli/config/get.rs

raw
1 //! Command-line parser for `sq config get`.
2
3 use clap::Args;
4
5 use crate::cli::examples::*;
6
7 #[derive(Debug, Args)]
8 #[clap(
9 name = "get",
10 about = "Get configuration options",
11 long_about = "\
12 Get configuration options
13
14 Retrieves the configuration with the given key. Use `sq config get` \
15 to see all available options and their values.",
16 after_help = GET_EXAMPLES,
17 )]
18 pub struct Command {
19 #[clap(
20 value_name = "NAME",
21 help = "Get the value of the configuration NAME",
22 )]
23 pub name: Option<String>,
24 }
25
26 const GET_EXAMPLES: Actions = Actions {
27 actions: &[
28 Action::Example(Example {
29 comment: "\
30 List all configuration options.",
31 command: &[
32 "sq", "config", "get",
33 ],
34 hide: &[],
35 }),
36
37 Action::Example(Example {
38 comment: "\
39 Get the default cipher suite for key generation.",
40 command: &[
41 "sq", "config", "get", "key.generate.cipher-suite",
42 ],
43 hide: &[],
44 }),
45 ]
46 };
47 test_examples!(sq_config_get, GET_EXAMPLES);