summaryrefslogtreecommitdiff
path: root/validate/argv.go
blob: c46149b65feb078d7deb9cb36585e4caec85d616 (plain)
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 (
	"os"

	"go.wit.com/dev/alexflint/arg"
)

var argv args

type args struct {
	List        bool `arg:"--list"         default:"false"    help:"list repos in your config"`
	SaveConfig  bool `arg:"--save"         default:"false"    help:"save your config file at the end"`
	Interesting bool `arg:"--interesting"  default:"false"    help:"something you decided was cool"`
}

func (a args) Description() string {
	return `
         forgeConfig -- add entries to your config files

This is just example protobuf code to test forgepb is working
but it could be used to automagically create a config file too.

If you need to change your config file, just edit the forge.text or forge.json
files then remove the forge.pb and ConfigLoad() will attempt to load those files instead
`
}

func (args) Version() string {
	return "virtigo " + VERSION
}

func init() {
	var pp *arg.Parser
	pp = arg.MustParse(&argv)

	if pp == nil {
		pp.WriteHelp(os.Stdout)
		os.Exit(0)
	}
}