summaryrefslogtreecommitdiff
path: root/argv.go
blob: 4da63f134139f46cbdb909923301dfada3bb9850 (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
package main

/*
	this parses the command line arguements
*/

var argv args

type args struct {
	All     bool `arg:"--all"       default:"false"    help:"redo every repo found in go/src or go.work"`
	Auto    bool `arg:"--auto"                         help:"don't approve via STDIN"`
	Trim    bool `arg:"--trim"      default:"true"     help:"trim entries from go.sum"`
	Verbose bool `arg:"--verbose"                      help:"show more"`
	Notes   bool `arg:"--metadata"                     help:"save as git metadata (notes)"`
	Restore bool `arg:"--restore"   default:"true"     help:"restore from git metadata"`
	Force   bool `arg:"--force"                        help:"remove things and redo them no matter what"`
	Strict  bool `arg:"--strict"    default:"false"    help:"never make go.* files unless everything is perfect"`
}

func (args) Version() string {
	return "go-mod-clean " + VERSION + "    Built on " + BUILDTIME
}

func (a args) Description() string {
	return `
go-mod-clean will try to verify your go.* files are using the newest package versions

* Recreate go.* with 'go mod init' and 'go mod tidy'
* Set your required go in go.mod (default is go1.21
* Check that the most recent master branch versions are used
* Try to trim go.sum of non-existent entries
`
}