From cd7d256a8040997467b5ec63aff182cdce207ca8 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Mon, 6 Jan 2025 18:14:33 -0600 Subject: [PATCH] even better bash --- Makefile | 36 +----------------------------------- argv.go | 6 +++--- main.go | 6 +++--- 3 files changed, 7 insertions(+), 41 deletions(-) diff --git a/Makefile b/Makefile index 0aa66dd..f2a4b9c 100644 --- a/Makefile +++ b/Makefile @@ -6,12 +6,8 @@ info: install @echo "make restart # remove the repos.pb file" @echo "make private # only the private ones" @echo "make mine # just show my repos" - @echo "make all # show all repos" @echo "make pull # run git pull on every repo" @echo "make dirty # CheckDirty()" - @echo "make user # git checkout user" - @echo "make master # git checkout master" - # forge vet: @GO111MODULE=off go vet @@ -37,33 +33,12 @@ gocui: install private: install forge list --private -fix: install - forge --fix list --all - -list-all: install - forge list --all - -git-reset: install - forge --do-git-reset list --all - -readonly: install - forge --list list --readonly - -config: install - forge config - -scan: install - forge do --scan - -pull: install +pull-mine: install forge pull --mine mine: install forge list --mine -all: install - forge list --all - patches-make: install forge --patchset "from makefile 2" @@ -83,12 +58,3 @@ restart: reset -rm ~/go/src/repos.pb make private - -user: install - forge user - -devel: install - forge devel --all - -master: install - forge master --all diff --git a/argv.go b/argv.go index d01841c..2e94309 100644 --- a/argv.go +++ b/argv.go @@ -15,8 +15,8 @@ type EmptyCmd struct { } type PatchCmd struct { - List bool `arg:"--list" help:"list available patches"` - Show string `arg:"--show" help:"show a specific patch"` + List *EmptyCmd `arg:"subcommand:list" help:"list available patches"` + Show *EmptyCmd `arg:"subcommand:show" help:"show a specific patch"` } type ConfigCmd struct { @@ -46,7 +46,7 @@ type args struct { Checkout *CheckoutCmd `arg:"subcommand:checkout" help:"switch git branches"` Config *ConfigCmd `arg:"subcommand:config" help:"show your .config/forge/ settings"` Dirty *EmptyCmd `arg:"subcommand:dirty" help:"check if your git repos are dirty"` - GitReset *EmptyCmd `arg:"subcommand:hard-reset" help:"hard reset your user git branch"` + GitReset *EmptyCmd `arg:"subcommand:hard-reset" help:"hard reset your user git branches"` List *FindCmd `arg:"subcommand:list" help:"just show a table of the current state"` Patch *PatchCmd `arg:"subcommand:patch" help:"examine and make patch sets"` GitPull *FindCmd `arg:"subcommand:pull" help:"run 'git pull'"` diff --git a/main.go b/main.go index 95c9311..8f52261 100644 --- a/main.go +++ b/main.go @@ -141,13 +141,13 @@ func main() { okExit("patches") } if argv.Patch != nil { - if argv.Patch.Show != "" { - sendDevelDiff(argv.Patch.Show) + if argv.Patch.Show != nil { + sendDevelDiff("fixme") // sendMasterDiff() okExit("patches") } - if argv.Patch.List { + if argv.Patch.List != nil { listPatches() okExit("patches") }