File tree 2 files changed +18
-9
lines changed
2 files changed +18
-9
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ for Fluent Localization System.
6
6
"""
7
7
version = " 0.0.1"
8
8
edition.workspace = true
9
- rust-version.workspace = true
9
+ rust-version = " 1.74.0 "
10
10
homepage.workspace = true
11
11
repository.workspace = true
12
12
license.workspace = true
@@ -29,4 +29,4 @@ fluent-syntax.workspace = true
29
29
serde = { workspace = true , features = [" derive" ]}
30
30
serde_json.workspace = true
31
31
annotate-snippets = { version = " 0.6" , features = [" color" ] }
32
- clap = " 2.33 "
32
+ clap = " 4.5 "
Original file line number Diff line number Diff line change 1
- use clap:: App ;
1
+ use clap:: { Arg , ArgAction , Command } ;
2
2
3
3
use fluent_cli:: parse_file;
4
4
5
5
fn main ( ) {
6
- let matches = App :: new ( "Fluent Parser" )
6
+ let matches = Command :: new ( "Fluent Parser" )
7
7
. version ( "0.0.1" )
8
8
. about ( "Parses FTL file into an AST" )
9
- . args_from_usage (
10
- "-s, --silent 'Disables error reporting'
11
- <FILE> 'FTL file to parse'" ,
9
+ . arg (
10
+ Arg :: new ( "silent" )
11
+ . short ( 's' )
12
+ . long ( "silent" )
13
+ . action ( ArgAction :: SetTrue )
14
+ . help ( "Disables error reporting" )
15
+ )
16
+ . arg (
17
+ Arg :: new ( "FILE" )
18
+ . required ( true )
19
+ . help ( "FTL file to parse" )
12
20
)
13
21
. get_matches ( ) ;
14
22
15
- let input = matches. value_of ( "FILE" ) . unwrap ( ) ;
16
- parse_file ( input, matches. is_present ( "silent" ) ) ;
23
+ let input: & String = matches. get_one ( "FILE" ) . unwrap ( ) ;
24
+ let silent: bool = * matches. get_one ( "silent" ) . unwrap ( ) ;
25
+ parse_file ( input, silent) ;
17
26
}
You can’t perform that action at this time.
0 commit comments