blob: 61ef7604d8950146fedf0ce4ea26adbe68827071 (
plain) (
blame)
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
package datamaps
import (
"os"
"path/filepath"
)
const (
config_dir_name = "datamaps-go"
db_name = "datamaps.db"
)
func getUserConfigDir() (string, error) {
dir, err := os.UserConfigDir()
config_path := filepath.Join(dir, config_dir_name)
if err != nil {
return "", err
}
return config_path, nil
}
type Options struct {
DBPath string
DMPath string
DMName string
DMOverwrite bool
DMInitial bool
DMData []DatamapLine
}
func defaultOptions() *Options {
return &Options{
DBPath: "PATH TO DB",
DMPath: "PATH TO DATAMAP",
DMName: "Unnamed Datamap",
DMOverwrite: false,
DMInitial: false,
DMData: make([]DatamapLine, 0),
}
}
func ParseOptions() *Options {
opts := defaultOptions()
return opts
}
|