Skip to content

Commit 1c29a32

Browse files
Update CLI docs to use i18n
1 parent e34ee27 commit 1c29a32

File tree

2 files changed

+107
-26
lines changed

2 files changed

+107
-26
lines changed

registry/locales/cli.yml

+81
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,86 @@
11
_version: 2
22
cli:
3+
about:
4+
en: Manage state of Windows registry
5+
# config command help
6+
config:
7+
about:
8+
en: Manage registry configuration.
9+
args:
10+
input:
11+
help:
12+
en: The registry JSON input.
13+
what_if:
14+
help:
15+
en: Run as a what-if operation instead of applying the registry configuration.
16+
get:
17+
about:
18+
en: Retrieve registry configuration.
19+
set:
20+
about:
21+
en: Apply registry configuration.
22+
delete:
23+
about:
24+
en: Delete registry configuration.
25+
# query command help
26+
query:
27+
about:
28+
en: Query a registry key or value.
29+
args:
30+
key_path:
31+
help:
32+
en: The registry key path to query.
33+
value_name:
34+
help:
35+
en: The name of the value to query.
36+
recurse:
37+
help:
38+
en: Recursively query subkeys.
39+
# set command help
40+
set:
41+
about:
42+
en: Set a registry key or value.
43+
args:
44+
key_path:
45+
help:
46+
en: The registry key path to set.
47+
value:
48+
help:
49+
en: The value to set.
50+
# remove command help
51+
remove:
52+
about:
53+
en: Remove a registry key or value.
54+
args:
55+
key_path:
56+
help:
57+
en: The registry key path to remove.
58+
value_name:
59+
help:
60+
en: The name of the value to remove.
61+
recurse:
62+
help:
63+
en: Recursively remove subkeys.
64+
# find command help
65+
find:
66+
about:
67+
en: Find a registry key or value.
68+
args:
69+
key_path:
70+
help:
71+
en: The registry key path to start find.
72+
find:
73+
help:
74+
en: The string to find.
75+
recurse:
76+
help:
77+
en: Recursively find.
78+
keys_only:
79+
help:
80+
en: Only find keys.
81+
values_only:
82+
help:
83+
en: Only find values.
384
# schema command help
485
schema:
586
about:

registry/src/args.rs

+26-26
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
use clap::{Parser, Subcommand};
55

66
#[derive(Parser)]
7-
#[clap(name = "registry", version = "0.0.1", about = "Manage state of Windows registry", long_about = None)]
7+
#[clap(name = "registry", version = "0.0.1", about = t!("cli.about").to_string(), long_about = None)]
88
pub struct Arguments {
99

1010
#[clap(subcommand)]
@@ -13,66 +13,66 @@ pub struct Arguments {
1313

1414
#[derive(Debug, PartialEq, Eq, Subcommand)]
1515
pub enum ConfigSubCommand {
16-
#[clap(name = "get", about = "Retrieve registry configuration.")]
16+
#[clap(name = "get", about = t!("cli.config.get.about").to_string())]
1717
Get {
18-
#[clap(short, long, required = true, help = "The registry JSON input.")]
18+
#[clap(short, long, required = true, help = t!("cli.config.args.input.help").to_string())]
1919
input: String,
2020
},
21-
#[clap(name = "set", about = "Apply registry configuration.")]
21+
#[clap(name = "set", about = t!("cli.config.set.about").to_string())]
2222
Set {
23-
#[clap(short, long, required = true, help = "The registry JSON input.")]
23+
#[clap(short, long, required = true, help = t!("cli.config.args.input.help").to_string())]
2424
input: String,
25-
#[clap(short = 'w', long, help = "Run as a what-if operation instead of applying the registry configuration")]
25+
#[clap(short = 'w', long, help = t!("cli.config.args.what_if.help").to_string())]
2626
what_if: bool,
2727
},
28-
#[clap(name = "delete", about = "Delete registry configuration.")]
28+
#[clap(name = "delete", about = t!("cli.config.delete.about").to_string())]
2929
Delete {
30-
#[clap(short, long, required = true, help = "The registry JSON input.")]
30+
#[clap(short, long, required = true, help = t!("cli.config.args.input.help").to_string())]
3131
input: String,
3232
},
3333
}
3434

3535
#[derive(Debug, PartialEq, Eq, Subcommand)]
3636
pub enum SubCommand {
37-
#[clap(name = "query", about = "Query a registry key or value.", arg_required_else_help = true)]
37+
#[clap(name = "query", about = t!("cli.query.about").to_string(), arg_required_else_help = true)]
3838
Query {
39-
#[clap(short, long, required = true, help = "The registry key path to query.")]
39+
#[clap(short, long, required = true, help = t!("cli.query.args.key_path.help").to_string())]
4040
key_path: String,
41-
#[clap(short, long, help = "The name of the value to query.")]
41+
#[clap(short, long, help = t!("cli.query.args.value_name.help").to_string())]
4242
value_name: Option<String>,
43-
#[clap(short, long, help = "Recursively query subkeys.")]
43+
#[clap(short, long, help = t!("cli.query.args.recurse.help").to_string())]
4444
recurse: bool,
4545
},
46-
#[clap(name = "set", about = "Set a registry key or value.")]
46+
#[clap(name = "set", about = t!("cli.set.about").to_string())]
4747
Set {
48-
#[clap(short, long, required = true, help = "The registry key path to set.")]
48+
#[clap(short, long, required = true, help = t!("cli.set.args.key_path.help").to_string())]
4949
key_path: String,
50-
#[clap(short, long, help = "The value to set.")]
50+
#[clap(short, long, help = t!("cli.set.args.value.help").to_string())]
5151
value: String,
5252
},
53-
#[clap(name = "remove", about = "Remove a registry key or value.", arg_required_else_help = true)]
53+
#[clap(name = "remove", about = t!("cli.remove.about").to_string(), arg_required_else_help = true)]
5454
Remove {
55-
#[clap(short, long, required = true, help = "The registry key path to remove.")]
55+
#[clap(short, long, required = true, help = t!("cli.remove.args.key_path.help").to_string())]
5656
key_path: String,
57-
#[clap(short, long, help = "The name of the value to remove.")]
57+
#[clap(short, long, help = t!("cli.remove.args.value_name.help").to_string())]
5858
value_name: Option<String>,
59-
#[clap(short, long, help = "Recursively remove subkeys.")]
59+
#[clap(short, long, help = t!("cli.remove.args.recurse.help").to_string())]
6060
recurse: bool,
6161
},
62-
#[clap(name = "find", about = "Find a registry key or value.", arg_required_else_help = true)]
62+
#[clap(name = "find", about = t!("cli.find.about").to_string(), arg_required_else_help = true)]
6363
Find {
64-
#[clap(short, long, required = true, help = "The registry key path to start find.")]
64+
#[clap(short, long, required = true, help = t!("cli.find.args.key_path.help").to_string())]
6565
key_path: String,
66-
#[clap(short, long, required = true, help = "The string to find.")]
66+
#[clap(short, long, required = true, help = t!("cli.find.args.find.help").to_string())]
6767
find: String,
68-
#[clap(short, long, help = "Recursively find.")]
68+
#[clap(short, long, help = t!("cli.find.args.recurse.help").to_string())]
6969
recurse: bool,
70-
#[clap(long, help = "Only find keys.")]
70+
#[clap(long, help = t!("cli.find.args.keys_only.help").to_string())]
7171
keys_only: bool,
72-
#[clap(long, help = "Only find values.")]
72+
#[clap(long, help = t!("cli.find.args.values_only.help").to_string())]
7373
values_only: bool,
7474
},
75-
#[clap(name = "config", about = "Manage registry configuration.", arg_required_else_help = true)]
75+
#[clap(name = "config", about = t!("cli.config.about").to_string(), arg_required_else_help = true)]
7676
Config {
7777
#[clap(subcommand)]
7878
subcommand: ConfigSubCommand,

0 commit comments

Comments
 (0)