-
Notifications
You must be signed in to change notification settings - Fork 6
/
config.go
29 lines (24 loc) · 957 Bytes
/
config.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package rokremoteconfig
import (
"flag"
"os"
"github.com/rokmonster/ocr/internal/pkg/config"
adb "github.com/zach-klippenstein/goadb"
)
type ROKRemoteConfig struct {
config.CommonConfiguration
ADBPort int
Server string
}
func Parse() ROKRemoteConfig {
var flags ROKRemoteConfig
flag.StringVar(&flags.MediaDirectory, "media", "./media", "folder where all files to scan is placed")
flag.StringVar(&flags.TemplatesDirectory, "templates", "./templates", "templates dir")
flag.StringVar(&flags.TessdataDirectory, "tessdata", "./tessdata", "tesseract data files directory")
flag.StringVar(&flags.OutputDirectory, "output", "./out", "output dir")
flag.StringVar(&flags.TmpDirectory, "tmp", os.TempDir(), "Directory for temporary files (cropped ones)")
flag.IntVar(&flags.ADBPort, "adb-port", adb.AdbPort, "ADB Port")
flag.StringVar(&flags.Server, "rok-server", "http://localhost:8080", "rokserver to connect to")
flag.Parse()
return flags
}