Skip to content

Commit

Permalink
Add support for -h | --help
Browse files Browse the repository at this point in the history
  • Loading branch information
mkchoi212 committed Jun 14, 2018
1 parent 8e39330 commit 2767e99
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
2 changes: 2 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ func die(err error) {
}

func main() {
ParseFlags()

var err error

keyBinding, err = binding.LoadSettings()
Expand Down
43 changes: 43 additions & 0 deletions options.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package main

import (
"flag"
"fmt"
"os"
)

// ParseFlags parses flags provided by the user
func ParseFlags() {
// Setup custom help message
flag.Usage = func() {
fmt.Fprintf(os.Stderr, `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
Following variables may be defined in your $HOME/.fac.yml to customize behavior
`)
}

flag.Parse()
}

0 comments on commit 2767e99

Please sign in to comment.