Some tweaks
This commit is contained in:
parent
09d907e650
commit
2785237198
20
cmd/main.go
20
cmd/main.go
@ -10,29 +10,25 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
var c string
|
var c = flag.String("config", "", "Configuration to load")
|
||||||
var user string
|
var user = flag.String("user", "", "user for aliases")
|
||||||
var debug bool
|
var debug = flag.Bool("debug", false, "Enables Debugging Mode")
|
||||||
|
|
||||||
flag.StringVar(&c, "config", "", "Configuration to load")
|
|
||||||
flag.StringVar(&user, "user", "", "user for aliases")
|
|
||||||
flag.BoolVar(&debug, "debug", false, "Enables Debugging Mode")
|
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
// Stop the app if they're missing required flags.
|
// Stop the app if they're missing required flags.
|
||||||
if c == "" {
|
if *c == "" {
|
||||||
log.Fatal("You need to specify a configuration file.")
|
log.Fatal("You need to specify a configuration file.")
|
||||||
}
|
}
|
||||||
|
|
||||||
if user == "" {
|
if *user == "" {
|
||||||
log.Fatal("You must specify a username.")
|
log.Fatal("You must specify a username.")
|
||||||
}
|
}
|
||||||
|
|
||||||
cfg, err := config.GetConfig(c, debug)
|
cfg, err := config.GetConfig(*c, *debug)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
data := resolver.PerformZoneTransfer(cfg, debug)
|
data := resolver.PerformZoneTransfer(cfg, *debug)
|
||||||
shell.CreateShellAliases(data, user, cfg, debug)
|
shell.CreateShellAliases(data, *user, cfg, *debug)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user