mirror of https://bitbucket.org/ausocean/av.git
main: moved flag.Parse() into handlFlags func to clean things up
This commit is contained in:
parent
575edd62a2
commit
b6ad8adc83
|
@ -128,14 +128,11 @@ func main() {
|
|||
{"HorizontalFlip", "Flip video horizontally: Yes, No"},
|
||||
{"LogPath", "Path for logging files (default is ../)"},
|
||||
}
|
||||
|
||||
// Create the configFlags based on the flagNames struct array
|
||||
for i, f := range &flagNames {
|
||||
configFlags[i] = flag.String(f.name, "", f.description)
|
||||
}
|
||||
|
||||
flag.Parse()
|
||||
|
||||
handleFlags()
|
||||
|
||||
err := run()
|
||||
|
@ -208,6 +205,8 @@ func run() error {
|
|||
|
||||
// handle flags interprets command line flags and sets revid config etc accordingly
|
||||
func handleFlags() {
|
||||
flag.Parse()
|
||||
|
||||
logPath := defaultLogPath
|
||||
if *configFlags[logPathPtr] != "" {
|
||||
logPath = *configFlags[logPathPtr]
|
||||
|
|
Loading…
Reference in New Issue