go-mod-clean/argv.go

33 lines
1.2 KiB
Go
Raw Normal View History

2024-12-10 14:07:14 -06:00
package main
/*
this parses the command line arguements
*/
var argv args
type args struct {
2024-12-13 02:21:25 -06:00
Trim bool `arg:"--trim" default:"true" help:"trim entries from go.sum"`
Verbose bool `arg:"--verbose" help:"show more"`
2024-12-18 01:29:07 -06:00
Restore bool `arg:"--restore" help:"only restore from go/pkg/mod/"`
Force bool `arg:"--force" help:"remove things and redo them no matter what"`
2024-12-18 01:29:07 -06:00
Strict bool `arg:"--strict" help:"never make go.* files unless everything is perfect"`
Purge bool `arg:"--purge" help:"purge all the git notes. this might be bad for you."`
2025-01-29 20:42:49 -06:00
Smart bool `arg:"--smart" help:"whatever seems best at the time. never os.Exit(-1)"`
2024-12-10 14:07:14 -06:00
}
func (args) Version() string {
return "go-mod-clean " + VERSION + " Built on " + BUILDTIME
2024-12-10 14:07:14 -06:00
}
func (a args) Description() string {
return `
go-mod-clean will try to verify your go.* files are using the newest package versions
2024-12-10 14:07:14 -06:00
2024-12-11 01:14:24 -06:00
* Recreate go.* with 'go mod init' and 'go mod tidy'
2024-12-15 08:46:01 -06:00
* Set your required go in go.mod (default is go1.21
2024-12-11 01:14:24 -06:00
* Check that the most recent master branch versions are used
* Try to trim go.sum of non-existent entries
2024-12-10 14:07:14 -06:00
`
}