-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
48 lines (39 loc) · 985 Bytes
/
main.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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package main
import (
"flag"
"log"
"os"
"github.com/zmnpl/ding/bubl"
"github.com/zmnpl/ding/core"
"github.com/zmnpl/ding/tui"
)
func main() {
checkDeps := flag.Bool("checkDependencies", false, "Check external depencies for different programm functions")
tview := flag.Bool("ui", false, "Run with tview UI")
out := flag.String("out", core.Dest, "Root path of your documents directory; where the documents should go")
in := flag.String("in", core.Inbound, "Path where your scans / inbound documents land")
flag.Parse()
if _, err := os.Stat(*out); !os.IsNotExist(err) {
if *out != core.Dest {
core.Dest = *out
}
} else {
log.Fatal("The given documentPath does not exist")
}
if _, err := os.Stat(*in); !os.IsNotExist(err) {
if *in != core.Inbound {
core.Inbound = *in
}
} else {
log.Fatal("The given inboundPath does not exist")
}
if *checkDeps {
core.PrintCheckDeps()
os.Exit(0)
}
if *tview {
tui.Start()
os.Exit(0)
}
bubl.Run()
}