diff options
| -rw-r--r-- | Makefile | 6 | ||||
| -rw-r--r-- | args.go | 30 | ||||
| -rw-r--r-- | main.go | 5 | ||||
| -rw-r--r-- | repolist.go | 26 |
4 files changed, 56 insertions, 11 deletions
@@ -11,7 +11,11 @@ stderr: build goimports: goimports -w *.go # // to globally reset paths: - # // gofmt -w -r "go.wit.com/gui -> go.wit.com/gui/gui" . + # // gofmt -w -r '"go.wit.com/gui/gadgets" -> "go.wit.com/lib/gadgets"' *.go + +gocui: build + reset + ./autotypist --gui gocui --tmp-log build: echo "build it!" @@ -0,0 +1,30 @@ +package main + +/* + this parses the command line arguements + + this enables command line options from other packages like 'gui' and 'log' +*/ + +import ( + "go.wit.com/dev/alexflint/arg" + "go.wit.com/lib/debugger" + "go.wit.com/log" +) + + // GadgetDisplay string `arg:"env:DISPLAY"` + // GadgetTmpLog bool `arg:"--tmp-log" help:"automatically send STDOUT to /tmp"` + // GadgetVerboseDNS bool `arg:"--verbose" help:"debug your dns settings"` +var args struct { + TmpLog bool `arg:"--tmp-log" help:"automatically send STDOUT to /tmp"` +} + +func init() { + arg.MustParse(&args) + + if debugger.ArgDebug() { + log.Info("cmd line --debugger == true") + } else { + log.Info("cmd line --debugger == false") + } +} @@ -17,6 +17,11 @@ func main() { me = new(autoType) me.allrepos = make(map[string]*repo) + if args.TmpLog { + // send all log() output to a file in /tmp + log.SetTmp() + } + me.myGui = gui.New() me.myGui.InitEmbed(resToolkit) // me.myGui.LoadToolkit("nocui") diff --git a/repolist.go b/repolist.go index c99e97f..ab1aa5f 100644 --- a/repolist.go +++ b/repolist.go @@ -197,9 +197,21 @@ func repolistWindow() { func repoAllButtons(box *gui.Node) { // reposbox.SetExpand(false) group1 := box.NewGroup("Run on all repos:") - grid1 := group1.NewGrid("test", 6, 1) - grid1.NewButton("merge all user to devel", func() { + hbox := group1.Box() + // hbox.Horizontal() + hbox.Vertical() + + box1 := hbox.Box().Vertical() + box1.NewButton("status.Update() all", func() { + for _, repo := range me.allrepos { + repo.status.Update() + repo.newScan() + } + }) + + box2 := hbox.Box().Vertical() + box2.NewButton("merge all user to devel", func() { reposwin.Disable() if !mergeAllUserToDevel() { return @@ -207,7 +219,7 @@ func repoAllButtons(box *gui.Node) { reposwin.Enable() }) - grid1.NewButton("merge all devel to main", func() { + box2.NewButton("merge all devel to main", func() { reposwin.Disable() if !mergeAllDevelToMain() { return @@ -215,7 +227,7 @@ func repoAllButtons(box *gui.Node) { reposwin.Enable() }) - grid1.NewButton("merge it all", func() { + box2.NewButton("merge it all", func() { reposwin.Disable() if !mergeAllUserToDevel() { return @@ -226,12 +238,6 @@ func repoAllButtons(box *gui.Node) { reposwin.Enable() }) - grid1.NewButton("status.Update() all", func() { - for _, repo := range me.allrepos { - repo.status.Update() - repo.newScan() - } - }) } func mergeAllDevelToMain() bool { |
