File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -54,6 +54,11 @@ fn main() {
54
54
. about ( "Returns a hint for the current exercise" )
55
55
. arg ( Arg :: with_name ( "name" ) . required ( true ) . index ( 1 ) ) ,
56
56
)
57
+ . subcommand (
58
+ SubCommand :: with_name ( "list" )
59
+ . alias ( "l" )
60
+ . about ( "Lists the exercises available in rustlings" )
61
+ )
57
62
. get_matches ( ) ;
58
63
59
64
if matches. subcommand_name ( ) . is_none ( ) {
@@ -88,6 +93,9 @@ fn main() {
88
93
let exercises = toml:: from_str :: < ExerciseList > ( toml_str) . unwrap ( ) . exercises ;
89
94
let verbose = matches. is_present ( "nocapture" ) ;
90
95
96
+ if matches. subcommand_matches ( "list" ) . is_some ( ) {
97
+ exercises. iter ( ) . for_each ( |e| println ! ( "{}" , e. name) ) ;
98
+ }
91
99
if let Some ( ref matches) = matches. subcommand_matches ( "run" ) {
92
100
let name = matches. value_of ( "name" ) . unwrap ( ) ;
93
101
You can’t perform that action at this time.
0 commit comments