more cleanups
This commit is contained in:
parent
2b087365f6
commit
2f7c1807a1
7
Makefile
7
Makefile
|
@ -11,7 +11,7 @@ info:
|
||||||
@echo "make dirty # CheckDirty()"
|
@echo "make dirty # CheckDirty()"
|
||||||
@echo "make user # git checkout user"
|
@echo "make user # git checkout user"
|
||||||
@echo "make master # git checkout master"
|
@echo "make master # git checkout master"
|
||||||
forge --do-gui
|
forge
|
||||||
|
|
||||||
vet:
|
vet:
|
||||||
@GO111MODULE=off go vet
|
@GO111MODULE=off go vet
|
||||||
|
@ -32,7 +32,7 @@ goimports:
|
||||||
@# // gofmt -w -r '"go.wit.com/gui/gadgets" -> "go.wit.com/lib/gadgets"' *.go
|
@# // gofmt -w -r '"go.wit.com/gui/gadgets" -> "go.wit.com/lib/gadgets"' *.go
|
||||||
|
|
||||||
gocui: install
|
gocui: install
|
||||||
forge --gui gocui --do-gui >/tmp/forge.log 2>&1
|
forge --gui gocui >/tmp/forge.log 2>&1
|
||||||
|
|
||||||
redomod-all:
|
redomod-all:
|
||||||
forge --do-RedoGoMod
|
forge --do-RedoGoMod
|
||||||
|
@ -70,9 +70,6 @@ mine: install
|
||||||
all: install
|
all: install
|
||||||
forge --find-all
|
forge --find-all
|
||||||
|
|
||||||
gui: install
|
|
||||||
forge --do-gui
|
|
||||||
|
|
||||||
patches: install
|
patches: install
|
||||||
forge --do-patches
|
forge --do-patches
|
||||||
|
|
||||||
|
|
56
argv.go
56
argv.go
|
@ -40,34 +40,20 @@ case args.Push != nil:
|
||||||
*/
|
*/
|
||||||
|
|
||||||
type args struct {
|
type args struct {
|
||||||
Find *FindCmd `arg:"subcommand:find" help:"select repos (for example, dirty or mine or read-only)"`
|
Find *FindCmd `arg:"subcommand:find" help:"select repos (for example, --all or --mine)"`
|
||||||
Do *DoCmd `arg:"subcommand:do" help:"do something ('git pull', 'build', 'install', etc)"`
|
Do *DoCmd `arg:"subcommand:do" help:"do something ('git pull', 'build', 'install', etc)"`
|
||||||
Config bool `arg:"--config" help:"show your .config/forge/ settings"`
|
Config bool `arg:"--config" help:"show your .config/forge/ settings"`
|
||||||
// FindAll bool `arg:"--find-all" help:"select every repo"`
|
DoPatchSet bool `arg:"--make-patchset" help:"make patch set"`
|
||||||
// FindReadOnly bool `arg:"--find-readonly" help:"include read-only repos"`
|
ListPatchSet bool `arg:"--list-patchset" help:"list patch sets"`
|
||||||
// FindMine bool `arg:"--find-mine" help:"download private and writeable repos"`
|
DryRun bool `arg:"--dry-run" help:"show what would be run"`
|
||||||
// FindFavorites bool `arg:"--find-favorites" help:"download repos marked as favorites"`
|
Fix bool `arg:"--fix" help:"fix config, save config & exit"`
|
||||||
// FindPrivate bool `arg:"--find-private" help:"list private repos in .config/forge/"`
|
Delete string `arg:"--delete" help:"delete this repo"`
|
||||||
// DoList bool `arg:"--do-list" help:"list found repos"`
|
Dirty bool `arg:"--dirty" help:"git CheckDirty() on every repo"`
|
||||||
// DoScan bool `arg:"--do-scan" help:"rescan your repos"`
|
User bool `arg:"--user" help:"git checkout user"`
|
||||||
// DoClone bool `arg:"--do-clone" help:"go-clone things you are missing"`
|
Devel bool `arg:"--devel" help:"git checkout devel"`
|
||||||
DoForce bool `arg:"--do-force" help:"force redo go-clone"`
|
Master bool `arg:"--master" help:"git checkout master"`
|
||||||
// DoGitPull bool `arg:"--do-git-pull" help:"run 'git pull' on all your repos"`
|
URL string `arg:"--connect" help:"gowebd url"`
|
||||||
// DoGitReset bool `arg:"--do-git-reset" help:"run 'git reset --hard' on all read-only repos"`
|
Register string `arg:"--register" help:"register your git URL (foo.com/mystuff) or (github.com/foo/bar)"`
|
||||||
// DoBuild bool `arg:"--do-build" default:"true" help:"also try to build it"`
|
|
||||||
// DoInstall bool `arg:"--do-install" help:"try to install every binary package"`
|
|
||||||
// DoRedoGoMod bool `arg:"--do-RedoGoMod" help:"remake all the go.sum and go.mod files"`
|
|
||||||
DoGui bool `arg:"--do-gui" help:"run the gui"`
|
|
||||||
DoPatchSet bool `arg:"--do-patches" help:"make patch set"`
|
|
||||||
ListPatchSet bool `arg:"--list-patches" help:"make patch set"`
|
|
||||||
DryRun bool `arg:"--dry-run" help:"show what would be run"`
|
|
||||||
Fix bool `arg:"--fix" help:"fix config, save config & exit"`
|
|
||||||
Delete string `arg:"--delete" help:"delete this repo"`
|
|
||||||
Dirty bool `arg:"--dirty" help:"git CheckDirty() on every repo"`
|
|
||||||
User bool `arg:"--user" help:"git checkout user"`
|
|
||||||
Master bool `arg:"--master" help:"git checkout master"`
|
|
||||||
URL string `arg:"--connect" help:"gowebd url"`
|
|
||||||
Register string `arg:"--register" help:"register your git URL (foo.com/mystuff) or (github.com/foo/bar)"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (args) Version() string {
|
func (args) Version() string {
|
||||||
|
@ -79,13 +65,15 @@ func (a args) Description() string {
|
||||||
forge -- in the spirit of things like sourceforge
|
forge -- in the spirit of things like sourceforge
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
forge --config # shows your forge config (~/.config/forge/)
|
forge --config # shows your forge config (~/.config/forge/)
|
||||||
forge --mine # find your private and writable repos
|
forge find --all do --pull # run 'git pull' in every repo
|
||||||
forge --favorites # find configured as favorites
|
forge find --mine do --clone # git clone every package you have in your config file
|
||||||
|
forge find --all do --build --dry-run # build every binary package (but just show what would run)
|
||||||
|
forge find --all --user # checkout the user branch
|
||||||
|
forge find --all --devel # checkout the devel branch
|
||||||
|
forge find --all --master # checkout the master branch
|
||||||
|
|
||||||
forge --git-pull # run 'git pull' in every repo
|
# these options are intended for automation. You probably just want to use the GUI.
|
||||||
forge --build --dry-run # build every binary package (but just show what would run)
|
|
||||||
forge --mine --clone # clone every package you have in your config file
|
|
||||||
`
|
`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
19
main.go
19
main.go
|
@ -7,6 +7,7 @@ import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"go.wit.com/dev/alexflint/arg"
|
"go.wit.com/dev/alexflint/arg"
|
||||||
|
"go.wit.com/gui"
|
||||||
"go.wit.com/lib/gui/shell"
|
"go.wit.com/lib/gui/shell"
|
||||||
"go.wit.com/lib/protobuf/forgepb"
|
"go.wit.com/lib/protobuf/forgepb"
|
||||||
"go.wit.com/lib/protobuf/gitpb"
|
"go.wit.com/lib/protobuf/gitpb"
|
||||||
|
@ -158,13 +159,17 @@ func main() {
|
||||||
okExit("patches")
|
okExit("patches")
|
||||||
}
|
}
|
||||||
|
|
||||||
// do the gui at the very end
|
// if the user doesn't want to open the GUI and
|
||||||
if argv.DoGui {
|
// nothing else was specified to be done,
|
||||||
doGui()
|
// then just list the table to stdout
|
||||||
}
|
if gui.NoGui() {
|
||||||
if !done {
|
if !done {
|
||||||
// if nothing was selected, print out a table of them on STDOUT
|
// if nothing was selected, print out a table of them on STDOUT
|
||||||
doCobol()
|
doCobol()
|
||||||
|
okExit("")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
// open the gui
|
||||||
|
doGui()
|
||||||
okExit("")
|
okExit("")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue