diff options
| author | Jeff Carr <[email protected]> | 2025-09-09 08:40:49 -0500 | 
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-09-09 08:40:49 -0500 | 
| commit | 8edefa6dadd1f4c3c43e145cc0431654720e2953 (patch) | |
| tree | 2d1198269c341a59a9f23fedc3efea37716cb86d | |
| parent | 18422bacebb2a99728abfcc1a1ee25cef42d2311 (diff) | |
fix something
| -rw-r--r-- | Makefile | 6 | ||||
| -rw-r--r-- | argv.go | 10 | ||||
| -rw-r--r-- | main.go | 31 | 
3 files changed, 33 insertions, 14 deletions
@@ -4,9 +4,9 @@ VERSION = $(shell git describe --tags)  DATE = $(shell date +%Y.%m.%d)  run: clean goimports vet install -	go-deb --release --no-gui --auto --forge go.wit.com/apps/autogenpb --dir /tmp/ -	go-deb --release --no-gui --auto --forge go.wit.com/apps/go-mod-clean --dir /tmp/ -	@#go-deb --forge go.wit.com/apps/autotypist --no-gui --auto +	go-deb --release --auto --forge go.wit.com/apps/autogenpb --dir /tmp/ +	go-deb --release --auto --forge go.wit.com/apps/go-mod-clean --dir /tmp/ +	@#go-deb --forge go.wit.com/apps/autotypist --auto  	ls -lth /tmp/*deb  vet: @@ -12,7 +12,9 @@ import (  */  type args struct { -	Commit    *EmptyCmd `arg:"subcommand:commit"                    help:"'git commit' but errors out if on wrong branch"` +	Commit    *EmptyCmd `arg:"subcommand:commit"        help:"'git commit' but errors out if on wrong branch"` +	Show      *EmptyCmd `arg:"subcommand:show"          help:"show what would be done"` +	Gui       *EmptyCmd `arg:"subcommand:gui"           help:"open the gui"`  	Auto      bool      `arg:"--auto"                   help:"automatically attempt to make the .deb"`  	Ldflags   []string  `arg:"--ldflags"                help:"flags to pass to go build"`  	Forge     string    `arg:"--forge"                  help:"use a git repo from forge"` @@ -21,8 +23,8 @@ type args struct {  	KeepFiles bool      `arg:"--keep-files"             help:"keep the build files/"`  	Force     bool      `arg:"--force" default:"false"  help:"force overwrite an existing .deb file"`  	Verbose   bool      `arg:"--verbose"                help:"show more things"` -	Bash      bool      `arg:"--bash"                               help:"generate bash completion"` -	BashAuto  []string  `arg:"--auto-complete"                      help:"todo: move this to go-arg"` +	Bash      bool      `arg:"--bash"                   help:"generate bash completion"` +	BashAuto  []string  `arg:"--auto-complete"          help:"todo: move this to go-arg"`  }  func (args) Version() string { @@ -54,7 +56,7 @@ func (a args) DoAutoComplete(argv []string) {  	default:  		if argv[0] == ARGNAME {  			// list the subcommands here -			fmt.Println("arch build") +			fmt.Println("arch build gui show")  		}  	}  	os.Exit(0) @@ -4,8 +4,9 @@ import (  	"embed"  	"os"  	"path/filepath" +	"time" -	"go.wit.com/gui" +	"go.wit.com/dev/alexflint/arg"  	"go.wit.com/lib/fhelp"  	"go.wit.com/lib/gui/prep"  	"go.wit.com/lib/gui/shell" @@ -25,6 +26,9 @@ var argv args  func main() {  	me = new(mainType) +	prep.Bash(ARGNAME, argv.DoAutoComplete) // this line should be:  prep.Bash(argv) +	me.myGui = prep.Gui()                   // prepares the GUI package for go-args +	me.pp = arg.MustParse(&argv)  	if err := fhelp.ConfigureENV(); err != nil {  		badExit(err) @@ -53,8 +57,11 @@ func main() {  		log.Info("found repo", me.repo.GetGoPath())  	}  	// build() +	if argv.Show != nil { +		log.Info("todo: show", me.repo.GetGoPath()) +		okExit("") +	} -	me.myGui = prep.Gui() // prepares the GUI package for go-args  	me.basicWindow = makebasicWindow()  	// figure out where we are working from @@ -94,10 +101,20 @@ func main() {  		os.Exit(0)  	} -	// only load teh toolkit if you get this far -	me.myGui.Start()      // loads the GUI toolkit -	me.basicWindow.Show() -	// go will sit here until the window exits -	gui.Watchdog() +	if argv.Gui != nil { +		// only load teh toolkit if you get this far +		me.myGui.Start() // loads the GUI toolkit +		me.basicWindow.Show() +		debug() +	} +	log.Info("go-deb: nothing to do in argv")  	os.Exit(0)  } + +func debug() { +	time.Sleep(2 * time.Second) +	for { +		log.Info("idle loop() todo: could check for things here") +		time.Sleep(90 * time.Second) +	} +}  | 
