forked from Bios-Marcel/cordless
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
39 lines (34 loc) · 1.33 KB
/
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
//+build go1.12
package main
import (
"flag"
"fmt"
"github.com/Bios-Marcel/cordless/app"
"github.com/Bios-Marcel/cordless/config"
"github.com/Bios-Marcel/cordless/shortcuts"
"github.com/Bios-Marcel/cordless/version"
)
func main() {
showVersion := flag.Bool("version", false, "Show the version instead of starting cordless")
showShortcutsDialog := flag.Bool("shortcut-dialog", false, "Shows the shortcuts dialog instead of launching cordless")
setConfigDirectory := flag.String("config-dir", "", "Sets the configuration directory")
setScriptDirectory := flag.String("script-dir", "", "Sets the script directory")
setConfigFilePath := flag.String("config-file", "", "Sets exact path of the configuration file")
flag.Parse()
if showShortcutsDialog != nil && *showShortcutsDialog {
shortcuts.RunShortcutsDialogStandalone()
} else if showVersion != nil && *showVersion {
fmt.Printf("You are running cordless version %s\nKeep in mind that this version might not be correct for manually built versions, as those can contain additional commits.\n", version.Version)
} else {
if setConfigDirectory != nil {
config.SetConfigDirectory(*setConfigDirectory)
}
if setScriptDirectory != nil {
config.SetScriptDirectory(*setScriptDirectory)
}
if setConfigFilePath != nil {
config.SetConfigFile(*setConfigFilePath)
}
app.Run()
}
}