Skip to content

Commit 9be0105

Browse files
committed
fix: default make-config path
1 parent 7adf369 commit 9be0105

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/cli.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ fn parse_time(arg: &str) -> Result<std::time::Duration, ParseError> {
2828
#[derive(Args, Debug, Clone)]
2929
pub 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,

src/main.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)