@@ -27,8 +27,22 @@ fn main() {
27
27
. version ( crate_version ! ( ) )
28
28
. author ( "Olivia Hugger, Carol Nichols" )
29
29
. about ( "Rustlings is a collection of small exercises to get you used to writing and reading Rust code" )
30
- . subcommand ( SubCommand :: with_name ( "verify" ) . alias ( "v" ) . about ( "Verifies all exercises according to the recommended order" ) )
31
- . subcommand ( SubCommand :: with_name ( "watch" ) . alias ( "w" ) . about ( "Reruns `verify` when files were edited" ) )
30
+ . arg (
31
+ Arg :: with_name ( "verbose" )
32
+ . short ( "V" )
33
+ . long ( "verbose" )
34
+ . help ( "Show tests' standard output" )
35
+ )
36
+ . subcommand (
37
+ SubCommand :: with_name ( "verify" )
38
+ . alias ( "v" )
39
+ . about ( "Verifies all exercises according to the recommended order" )
40
+ )
41
+ . subcommand (
42
+ SubCommand :: with_name ( "watch" )
43
+ . alias ( "w" )
44
+ . about ( "Reruns `verify` when files were edited" )
45
+ )
32
46
. subcommand (
33
47
SubCommand :: with_name ( "run" )
34
48
. alias ( "r" )
@@ -43,7 +57,7 @@ fn main() {
43
57
)
44
58
. get_matches ( ) ;
45
59
46
- if None == matches. subcommand_name ( ) {
60
+ if matches. subcommand_name ( ) . is_none ( ) {
47
61
println ! ( ) ;
48
62
println ! ( r#" welcome to... "# ) ;
49
63
println ! ( r#" _ _ _ "# ) ;
@@ -105,22 +119,20 @@ fn main() {
105
119
verify ( & exercises) . unwrap_or_else ( |_| std:: process:: exit ( 1 ) ) ;
106
120
}
107
121
108
- if matches. subcommand_matches ( "watch" ) . is_some ( ) {
109
- if watch ( & exercises) . is_ok ( ) {
110
- println ! (
111
- "{emoji} All exercises completed! {emoji}" ,
112
- emoji = Emoji ( "🎉" , "★" )
113
- ) ;
114
- println ! ( "" ) ;
115
- println ! ( "We hope you enjoyed learning about the various aspects of Rust!" ) ;
116
- println ! (
117
- "If you noticed any issues, please don't hesitate to report them to our repo."
118
- ) ;
119
- println ! ( "You can also contribute your own exercises to help the greater community!" ) ;
120
- println ! ( "" ) ;
121
- println ! ( "Before reporting an issue or contributing, please read our guidelines:" ) ;
122
- println ! ( "https://github.com/rust-lang/rustlings/blob/master/CONTRIBUTING.md" ) ;
123
- }
122
+ if matches. subcommand_matches ( "watch" ) . is_some ( ) && watch ( & exercises) . is_ok ( ) {
123
+ println ! (
124
+ "{emoji} All exercises completed! {emoji}" ,
125
+ emoji = Emoji ( "🎉" , "★" )
126
+ ) ;
127
+ println ! ( ) ;
128
+ println ! ( "We hope you enjoyed learning about the various aspects of Rust!" ) ;
129
+ println ! (
130
+ "If you noticed any issues, please don't hesitate to report them to our repo."
131
+ ) ;
132
+ println ! ( "You can also contribute your own exercises to help the greater community!" ) ;
133
+ println ! ( ) ;
134
+ println ! ( "Before reporting an issue or contributing, please read our guidelines:" ) ;
135
+ println ! ( "https://github.com/rust-lang/rustlings/blob/master/CONTRIBUTING.md" ) ;
124
136
}
125
137
126
138
if matches. subcommand_name ( ) . is_none ( ) {
0 commit comments