File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 11use clap:: { App , Arg } ;
2+ use postman2openapi:: { from_path, from_str, TranspileOptions } ;
23use std:: io:: { stdin, Read } ;
34
45fn main ( ) {
@@ -29,14 +30,14 @@ fn main() {
2930 let matches = app. get_matches ( ) ;
3031
3132 let mut buffer = String :: new ( ) ;
32- let output_format = matches. value_of_t ( "output" ) . unwrap_or_else ( |e| e. exit ( ) ) ;
33+ let format = matches. value_of_t ( "output" ) . unwrap_or_else ( |e| e. exit ( ) ) ;
3334 match & matches. value_of ( "INPUT" ) {
34- Some ( filename) => match postman2openapi :: from_path ( filename, output_format ) {
35+ Some ( filename) => match from_path ( filename, TranspileOptions { format } ) {
3536 Ok ( oas) => println ! ( "{}" , oas) ,
3637 Err ( err) => eprintln ! ( "{}" , err) ,
3738 } ,
3839 None => match stdin ( ) . read_to_string ( & mut buffer) {
39- Ok ( _) => match postman2openapi :: from_str ( & buffer, output_format ) {
40+ Ok ( _) => match from_str ( & buffer, TranspileOptions { format } ) {
4041 Ok ( oas) => println ! ( "{}" , oas) ,
4142 Err ( err) => eprintln ! ( "{}" , err) ,
4243 } ,
You can’t perform that action at this time.
0 commit comments