fix #2: add flag --create-config to create a default config

This commit is contained in:
2026-01-05 11:29:35 +01:00
parent 85d23c42f0
commit 293b8ba144
5 changed files with 119 additions and 20 deletions

View File

@@ -52,6 +52,20 @@ func Execute(output io.Writer) int {
return 0
}
if conf.CreateConfig {
msg, err := conf.WriteConfigFile()
if err != nil {
return Die(err)
}
_, err = fmt.Fprintln(output, msg)
if err != nil {
return Die(fmt.Errorf("failed to print to output: %s", err))
}
return 0
}
if conf.StoreProgress {
progress, err := GetProgress(conf)
if err == nil {