diff options
| -rw-r--r-- | argv.go | 12 | ||||
| -rw-r--r-- | doRebuild.go (renamed from doDownloadForge.go) | 12 | ||||
| -rw-r--r-- | main.go | 4 | ||||
| -rw-r--r-- | windowHowto.go | 2 |
4 files changed, 23 insertions, 7 deletions
@@ -34,11 +34,11 @@ type args struct { Fixer *FixCmd `arg:"subcommand:fixer" help:"send in the fixer"` Verify *VerifyCmd `arg:"subcommand:verify" help:"populate stats"` Whatchanged *EmptyCmd `arg:"subcommand:whatchanged" help:"being deprecated (perhaps?). this is just for finger memory."` + Rebuild *RebuildCmd `arg:"subcommand:rebuild" help:"download all the forge sources and rebuild forge"` All bool `arg:"--all" help:"whatever you are doing, do it all over"` Force bool `arg:"--force" help:"try to strong-arm things"` Verbose bool `arg:"--verbose" help:"show more output than usual"` Fix bool `arg:"--fix" help:"try to make repairs"` - BuildForge bool `arg:"--forge-rebuild" help:"download all the forge sources and rebuild forge"` } type EmptyCmd struct { @@ -55,6 +55,12 @@ type ShowCmd struct { Tag *TagCmd `arg:"subcommand:tag" help:"show git tags"` } +type RebuildCmd struct { + Forge *EmptyCmd `arg:"subcommand:forge" help:"rebuild forge"` + GoClone *EmptyCmd `arg:"subcommand:go-clone" help:"rebuild go-clone"` + Autogenpb *EmptyCmd `arg:"subcommand:autogenpb" help:"rebuild autogenpb"` +} + type FixCmd struct { Porcelain *EmptyCmd `arg:"subcommand:porcelain" help:"git status --porcelain"` Urls bool `arg:"--urls" help:"check for changes in repo urls"` @@ -237,9 +243,9 @@ func (args) Examples() string { func (a args) SendCompletionStrings(pb *prep.Auto) { if pb.Cmd == "" { // these are base autocomplete strings - matches := []string{"checkout", "clean", "commit", "merge", "patch", "normal", "pull"} + matches := []string{"checkout", "clean", "commit", "merge", "patch", "normal", "pull", "rebuild"} matches = append(matches, "show", "add", "fixer", "dev", "verify", "mode", "gui", "whatchanged") - matches = append(matches, "--version", "--force", "--all", "--forge-rebuild") + matches = append(matches, "--version", "--force", "--all") pb.SendStrings(matches) } else { // autogenerate the strings for the subcommand using github.com/alexflint/go-arg diff --git a/doDownloadForge.go b/doRebuild.go index f690370..0192cd7 100644 --- a/doDownloadForge.go +++ b/doRebuild.go @@ -15,7 +15,17 @@ import ( ) // download forge. A good way to check things work -func doDownloadForge() (string, error) { +func doRebuild() (string, error) { + var s string + var err error + + if argv.Rebuild.Forge != nil { + s, err = doRebuildForge() + } + return s, err +} + +func doRebuildForge() (string, error) { log.Info("download here") if path, err := fhelp.CheckCmd("go-clone"); err != nil { log.Info("go-clone missing", path, err) @@ -173,10 +173,10 @@ func main() { err = r.Error } - if argv.BuildForge { + if argv.Rebuild != nil { // attempts to download all the sources // and binaries needed to build forge - s, err = doDownloadForge() + s, err = doRebuild() } if argv.Verify != nil { diff --git a/windowHowto.go b/windowHowto.go index f626af3..a556449 100644 --- a/windowHowto.go +++ b/windowHowto.go @@ -42,7 +42,7 @@ func makeHowtoWin() *gadgets.GenericWindow { grid.NewButton("Download into "+me.forge.Config.ReposDir, func() { howtoWin.Disable() defer howtoWin.Enable() - doDownloadForge() + doRebuildForge() }) return howtoWin } |
