diff options
Diffstat (limited to 'argv.go')
| -rw-r--r-- | argv.go | 44 |
1 files changed, 33 insertions, 11 deletions
@@ -27,19 +27,33 @@ type args struct { Patch *PatchCmd `arg:"subcommand:patch" help:"make patchsets"` Pull *PullCmd `arg:"subcommand:pull" help:"run 'git pull'"` Show *ShowCmd `arg:"subcommand:show" help:"print out things"` + Dev *DevCmd `arg:"subcommand:dev" help:"features under development"` All bool `arg:"--all" help:"git commit --all"` Force bool `arg:"--force" help:"try to strong-arm things"` Verbose bool `arg:"--verbose" help:"show more output"` } +func (args) Examples() string { + var out string + out += "forge merge --all # merge all patches to devel & master\n" + out += "forge pull --force # 'git pull' on all repos\n" + out += "forge normal # the defaults for 'normal' forge distributed development\n" + return out +} + +type EmptyCmd struct { +} + +type testCmd string + type ShowCmd struct { Dirty *EmptyCmd `arg:"subcommand:dirty" help:"show dirty git repos"` - Repo *RepoCmd `arg:"subcommand:repo" help:"print a table of the current repos"` + Repo *RepoCmd `arg:"subcommand:repos" help:"print a table of the current repos"` Tag *TagCmd `arg:"subcommand:tag" help:"show git tags"` - // Build string `arg:"--build" help:"build a repo"` - // Install string `arg:"--install" help:"install a repo"` - // BuildForge bool `arg:"--forge-rebuild" help:"download and rebuild forge"` - // URL string `arg:"--connect" help:"forge url"` +} + +func (ShowCmd) Examples() string { + return "forge show dirty\nforge show repos --all" } type RepoCmd struct { @@ -52,9 +66,6 @@ type RepoCmd struct { // ReadOnly bool `arg:"--readonly" help:"include read-only repos"` } -type EmptyCmd struct { -} - type NormalCmd struct { On *EmptyCmd `arg:"subcommand:on" help:"turn normal mode on"` Off *EmptyCmd `arg:"subcommand:off" help:"turn normal mode off"` @@ -65,11 +76,22 @@ type CommitCmd struct { All bool `arg:"--all" help:"git commit in all dirty repos"` } -type testCmd string +type DevCmd struct { + Build string `arg:"--build" help:"build a repo"` + Install string `arg:"--install" help:"install a repo"` + BuildForge bool `arg:"--forge-rebuild" help:"download and rebuild forge"` + URL string `arg:"--connect" help:"forge url"` +} type CleanCmd struct { - // Verify *EmptyCmd `arg:"subcommand:verify" help:"rescan repo"` - // Repo string `arg:"--repo" help:"which repo to look at"` + Verify *EmptyCmd `arg:"subcommand:fix" help:"try to fix problems"` + Repo string `arg:"--repo" help:"which repo to look at"` +} + +// matches +func (c CleanCmd) Match(partial string) []string { + // return repos here + return []string{"go.wit.com/apps/forge", "go.wit.com/apps/virtigo"} } type CleanDevelCmd struct { |
