forked from kcmerrill/alfred
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathalfred.go
41 lines (35 loc) · 843 Bytes
/
alfred.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
package main
import (
"flag"
"fmt"
"os"
"github.com/kcmerrill/alfred/alfred"
)
var (
Version = "dev"
Commit = "n/a"
)
func main() {
dir := flag.String("dir", ".", "Directory where your alfred files are stored")
serve := flag.Bool("serve", false, "Start alfred's webserver to share alfred files")
port := flag.String("port", "8080", "Alfred's webserver port")
version := flag.Bool("version", false, "Alfred's version number")
flag.Parse()
/* Giddy up! */
if *version {
fmt.Println()
fmt.Println("Alfred - Because even Batman needs a little help.")
fmt.Println("---")
fmt.Println("Version: ", Version)
fmt.Println("CommitId: ", Commit)
fmt.Println("---")
fmt.Println("Made with <3 by http://kcmerrill.com")
fmt.Println()
return
}
if *serve {
alfred.Serve(*dir, *port)
return
}
alfred.New(os.Args)
}