File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed
Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -93,8 +93,8 @@ pub struct ToTomlArgs {
9393#[ command( alias = "ch" ) ]
9494pub struct CheckArgs {
9595 /// Input filename or "-" for STDIN
96- #[ arg( value_name = "FILE" ) ]
97- pub filename : String ,
96+ #[ arg( value_name = "FILE" , num_args = 1 .. ) ]
97+ pub filenames : Vec < String > ,
9898}
9999
100100// --------------------------------------------------
@@ -109,8 +109,16 @@ fn main() {
109109fn run ( args : Cli ) -> Result < ( ) > {
110110 match & args. command {
111111 Some ( Command :: Check ( args) ) => {
112- let meta = parse_file ( & args. filename ) ?;
113- println ! ( "{}" , meta. check( ) . join( "\n " ) ) ;
112+ let num_files = args. filenames . len ( ) ;
113+ for filename in & args. filenames {
114+ if num_files > 1 {
115+ println ! ( "==> {filename} <==" )
116+ }
117+ match parse_file ( filename) {
118+ Ok ( meta) => println ! ( "{}" , meta. check( ) . join( "\n " ) ) ,
119+ Err ( e) => println ! ( "{e}" ) ,
120+ }
121+ }
114122 ( )
115123 }
116124 Some ( Command :: Example ( args) ) => {
You can’t perform that action at this time.
0 commit comments