Browse Source

Add main file and calculate config file path

master
Elis Hirwing 4 years ago
parent
commit
98269b10ee
Signed by: etu GPG Key ID: D57EFA625C9A925F
  1. 29
      main.go

29
main.go

@ -0,0 +1,29 @@
package main
import (
"flag"
"fmt"
"github.com/cep21/xdgbasedir"
)
type args struct {
ConfigFile *string
}
func main() {
args := args{
ConfigFile: flag.String(
"config", getDefaultConfigName(), "Usage about option",
),
}
flag.Parse()
fmt.Println(*args.ConfigFile)
}
func getDefaultConfigName() string {
configHome, _ := xdgbasedir.ConfigHomeDirectory()
return fmt.Sprintf("%s/promptkit.toml", configHome)
}
Loading…
Cancel
Save