have typed default config

This commit is contained in:
Jesse Duffield 2020-10-04 09:53:56 +11:00
parent ca31e5258f
commit 7d9aa97f96
4 changed files with 424 additions and 380 deletions

10
main.go
View file

@ -48,6 +48,9 @@ func main() {
configFlag := false
flaggy.Bool(&configFlag, "c", "config", "Print the default config")
configDirFlag := false
flaggy.Bool(&configDirFlag, "cd", "config-dir", "Print the config directory")
workTree := ""
flaggy.String(&workTree, "w", "work-tree", "equivalent of the --work-tree git argument")
@ -85,7 +88,12 @@ func main() {
if err != nil {
log.Fatal(err.Error())
}
fmt.Printf("%v\n", buf.String())
fmt.Printf("%s\n", buf.String())
os.Exit(0)
}
if configDirFlag {
fmt.Printf("%s\n", config.ConfigDir())
os.Exit(0)
}