From 3895519f25a603b6b75b54c0d9ad57b7128045ac Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Mon, 2 Dec 2024 06:59:56 -0600 Subject: start developing this for real --- argv.go | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 argv.go (limited to 'argv.go') diff --git a/argv.go b/argv.go new file mode 100644 index 0000000..3c19f8b --- /dev/null +++ b/argv.go @@ -0,0 +1,39 @@ +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"` + 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:"--go-reset" help:"remake all the go.sum and go.mod files"` + DryRun bool `arg:"--dry-run" help:"show what would be run"` +} + +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 +` +} -- cgit v1.2.3