-
Notifications
You must be signed in to change notification settings - Fork 51
/
Copy pathoptions.go
54 lines (42 loc) · 1.04 KB
/
options.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
49
50
51
52
53
54
package main
import (
"flag"
"fmt"
"os"
)
const (
version = "2.0"
help = `Usage:
fac
Customizable variables:
Behavior
cont_eval evaluate commands without pressing ENTER
Key bindings
select_local select local version
select_incoming select incoming version
toggle_view toggle to horizontal | horizontal view
show_up show more lines above
show_down show more lines below
scroll_up ...
scroll_down ...
edit manually edit code chunk
next go to next conflict
previous go to previous conflict
quit ...
help display help in side bar
Define above variables in your $HOME/.fac.yml to customize behavior
`
)
// ParseFlags parses flags provided by the user
func ParseFlags() {
// Setup custom help message
flag.Usage = func() {
fmt.Fprintf(os.Stderr, help)
}
showVersion := flag.Bool("version", false, "Print the version of fac being run")
flag.Parse()
if *showVersion {
fmt.Printf("fac %s\n", version)
os.Exit(0)
}
}