Added a flag called 'generate-config' which will generate default config files.

master
Aadhavan Srinivasan 2 months ago
parent 7feac0b5f7
commit 94d1d99af2

@ -2,6 +2,7 @@ package main
import ( import (
"errors" "errors"
"flag"
"fmt" "fmt"
"os" "os"
"path/filepath" "path/filepath"
@ -59,6 +60,12 @@ func printFile(fileName string) {
} }
func main() { func main() {
generateConfigFlag := flag.Bool("generate-config", false, "Generate default config files")
flag.Parse()
if *generateConfigFlag {
generateDefaultConfigs()
os.Exit(0)
}
// Check if user has provided a file name // Check if user has provided a file name
if len(os.Args) != 2 { if len(os.Args) != 2 {

Loading…
Cancel
Save