File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed
Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ fn parse_time(arg: &str) -> Result<std::time::Duration, ParseError> {
2828#[ derive( Args , Debug , Clone ) ]
2929pub struct MakeConfigArgs {
3030 #[ arg( short = 'o' , long = "output" , help = "Output path" ) ]
31- pub output_path : PathBuf ,
31+ pub output_path : Option < PathBuf > ,
3232
3333 #[ arg( short = 'u' , long = "username" , help = "ITÜ Kullanıcı Adı" ) ]
3434 pub username : String ,
Original file line number Diff line number Diff line change @@ -68,10 +68,11 @@ async fn main() {
6868
6969 match cli. command {
7070 cli:: Command :: MakeConfig ( make_config_args) => {
71- match write_config (
72- make_config_args. output_path . as_path ( ) ,
73- & make_config_args. clone ( ) . into ( ) ,
74- ) {
71+ let output_path = make_config_args
72+ . output_path
73+ . clone ( )
74+ . unwrap_or ( PathBuf :: from ( DEFAULT_CONFIG_PATH ) ) ;
75+ match write_config ( & output_path, & make_config_args. clone ( ) . into ( ) ) {
7576 Ok ( _) => ( ) ,
7677 Err ( e) => eprintln ! ( "{}" , e) ,
7778 }
You can’t perform that action at this time.
0 commit comments