summaryrefslogtreecommitdiff
path: root/argv.go
blob: 02371825ae4cf4a85621e8a69ec662c44de3b1cf (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
42
43
44
45
46
package main

/*
	this parses the command line arguements
*/

var argv args

type args struct {
	List      bool   `arg:"--list"                         help:"list found repos"`
	ListConf  bool   `arg:"--list-conf"                    help:"list your .config/forge/ configuration"`
	Scan      bool   `arg:"--scan"                         help:"rescan your repos"`
	ReadOnly  bool   `arg:"--readonly"                     help:"include read-only repos"`
	GetMine   bool   `arg:"--mine"                         help:"download private and writeable repos"`
	GetFav    bool   `arg:"--favorites"                    help:"download repos marked as favorites"`
	Pull      bool   `arg:"--git-pull"                     help:"run 'git pull' on all your repos"`
	Build     bool   `arg:"--build"      default:"true"    help:"also try to build it"`
	Install   bool   `arg:"--install"                      help:"try to install every binary package"`
	RedoGoMod bool   `arg:"--RedoGoMod"                    help:"remake all the go.sum and go.mod files"`
	DryRun    bool   `arg:"--dry-run"                      help:"show what would be run"`
	Real      bool   `arg:"--fix"                          help:"fix config, save config & exit"`
	Repomap   string `arg:"--repomap"                      help:"parse a repomap from gowebd"`
	Clone     bool   `arg:"--clone"                        help:"go-clone things you are missing"`
	Force     bool   `arg:"--force"                        help:"force redo go-clone"`
	Erase     bool   `arg:"--erase"                        help:"erase"`
}

func (args) Version() string {
	return "forge " + VERSION + "    Built on " + BUILDTIME
}

func (a args) Description() string {
	return `
forge -- in the spirit of things like sourceforge

Repository configuration is stored in .config/forge/forge.text

Examples:
	forge  --list                                # list found repos
	forge  --mine                                # download your private and writable repos
	forge  --favorites                           # clone repos you marked as favorites
	forge  --git-pull                            # run 'git pull' in every repo
	forge  --build                               # build every binary package
	forge  --install                             # install every binary package
`
}