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"},
|
{"HorizontalFlip", "Flip video horizontally: Yes, No"},
|
||||||
{"LogPath", "Path for logging files (default is ../)"},
|
{"LogPath", "Path for logging files (default is ../)"},
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create the configFlags based on the flagNames struct array
|
// Create the configFlags based on the flagNames struct array
|
||||||
for i, f := range &flagNames {
|
for i, f := range &flagNames {
|
||||||
configFlags[i] = flag.String(f.name, "", f.description)
|
configFlags[i] = flag.String(f.name, "", f.description)
|
||||||
}
|
}
|
||||||
|
|
||||||
flag.Parse()
|
|
||||||
|
|
||||||
handleFlags()
|
handleFlags()
|
||||||
|
|
||||||
err := run()
|
err := run()
|
||||||
|
@ -208,6 +205,8 @@ func run() error {
|
||||||
|
|
||||||
// handle flags interprets command line flags and sets revid config etc accordingly
|
// handle flags interprets command line flags and sets revid config etc accordingly
|
||||||
func handleFlags() {
|
func handleFlags() {
|
||||||
|
flag.Parse()
|
||||||
|
|
||||||
logPath := defaultLogPath
|
logPath := defaultLogPath
|
||||||
if *configFlags[logPathPtr] != "" {
|
if *configFlags[logPathPtr] != "" {
|
||||||
logPath = *configFlags[logPathPtr]
|
logPath = *configFlags[logPathPtr]
|
||||||
|
|
Loading…
Reference in New Issue