4
4
use clap:: { Parser , Subcommand } ;
5
5
6
6
#[ 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 ) ]
8
8
pub struct Arguments {
9
9
10
10
#[ clap( subcommand) ]
@@ -13,66 +13,66 @@ pub struct Arguments {
13
13
14
14
#[ derive( Debug , PartialEq , Eq , Subcommand ) ]
15
15
pub enum ConfigSubCommand {
16
- #[ clap( name = "get" , about = "Retrieve registry configuration." ) ]
16
+ #[ clap( name = "get" , about = t! ( "cli.config.get.about" ) . to_string ( ) ) ]
17
17
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 ( ) ) ]
19
19
input : String ,
20
20
} ,
21
- #[ clap( name = "set" , about = "Apply registry configuration." ) ]
21
+ #[ clap( name = "set" , about = t! ( "cli.config.set.about" ) . to_string ( ) ) ]
22
22
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 ( ) ) ]
24
24
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 ( ) ) ]
26
26
what_if : bool ,
27
27
} ,
28
- #[ clap( name = "delete" , about = "Delete registry configuration." ) ]
28
+ #[ clap( name = "delete" , about = t! ( "cli.config.delete.about" ) . to_string ( ) ) ]
29
29
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 ( ) ) ]
31
31
input : String ,
32
32
} ,
33
33
}
34
34
35
35
#[ derive( Debug , PartialEq , Eq , Subcommand ) ]
36
36
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 ) ]
38
38
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 ( ) ) ]
40
40
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 ( ) ) ]
42
42
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 ( ) ) ]
44
44
recurse : bool ,
45
45
} ,
46
- #[ clap( name = "set" , about = "Set a registry key or value." ) ]
46
+ #[ clap( name = "set" , about = t! ( "cli.set.about" ) . to_string ( ) ) ]
47
47
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 ( ) ) ]
49
49
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 ( ) ) ]
51
51
value : String ,
52
52
} ,
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 ) ]
54
54
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 ( ) ) ]
56
56
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 ( ) ) ]
58
58
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 ( ) ) ]
60
60
recurse : bool ,
61
61
} ,
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 ) ]
63
63
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 ( ) ) ]
65
65
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 ( ) ) ]
67
67
find : String ,
68
- #[ clap( short, long, help = "Recursively find." ) ]
68
+ #[ clap( short, long, help = t! ( "cli. find.args.recurse.help" ) . to_string ( ) ) ]
69
69
recurse : bool ,
70
- #[ clap( long, help = "Only find keys." ) ]
70
+ #[ clap( long, help = t! ( "cli. find.args.keys_only.help" ) . to_string ( ) ) ]
71
71
keys_only : bool ,
72
- #[ clap( long, help = "Only find values." ) ]
72
+ #[ clap( long, help = t! ( "cli. find.args.values_only.help" ) . to_string ( ) ) ]
73
73
values_only : bool ,
74
74
} ,
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 ) ]
76
76
Config {
77
77
#[ clap( subcommand) ]
78
78
subcommand : ConfigSubCommand ,
0 commit comments