diff options
| author | Russ Cox <rsc@golang.org> | 2015-01-30 12:25:50 -0500 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2015-01-30 19:31:47 +0000 |
| commit | 28fbeb1f505cc97fa0ebb1eefc62d65749cfdfb5 (patch) | |
| tree | 990d7911a535819c70b1c9548d74246c09e7f45d /git-codereview | |
| parent | 0dfa64fa8ebb5b99dcf6b5a3f6684441d90a37d7 (diff) | |
| download | go-x-review-28fbeb1f505cc97fa0ebb1eefc62d65749cfdfb5.tar.xz | |
git-codereview: use cmd prefix on command implementation funcs
The name space is getting a bit crowded.
These words are too easy to use for other variables or functions.
Change-Id: Iedbccb82f85627fe422a029a6b45ad39a2e18dd0
Reviewed-on: https://go-review.googlesource.com/3627
Reviewed-by: Rob Pike <r@golang.org>
Diffstat (limited to 'git-codereview')
| -rw-r--r-- | git-codereview/branch.go | 4 | ||||
| -rw-r--r-- | git-codereview/change.go | 2 | ||||
| -rw-r--r-- | git-codereview/gofmt.go | 2 | ||||
| -rw-r--r-- | git-codereview/hook.go | 2 | ||||
| -rw-r--r-- | git-codereview/mail.go | 2 | ||||
| -rw-r--r-- | git-codereview/pending.go | 2 | ||||
| -rw-r--r-- | git-codereview/review.go | 18 | ||||
| -rw-r--r-- | git-codereview/submit.go | 2 | ||||
| -rw-r--r-- | git-codereview/sync.go | 2 |
9 files changed, 18 insertions, 18 deletions
diff --git a/git-codereview/branch.go b/git-codereview/branch.go index 38933b0..cabe7f6 100644 --- a/git-codereview/branch.go +++ b/git-codereview/branch.go @@ -347,12 +347,12 @@ func (b *Branch) DefaultCommit(action string) *Commit { return work[0] } -func branchpoint(args []string) { +func cmdBranchpoint(args []string) { expectZeroArgs(args, "sync") fmt.Fprintf(stdout(), "%s\n", CurrentBranch().Branchpoint()) } -func rebasework(args []string) { +func cmdRebaseWork(args []string) { expectZeroArgs(args, "rebase-work") b := CurrentBranch() if HasStagedChanges() || HasUnstagedChanges() { diff --git a/git-codereview/change.go b/git-codereview/change.go index ae761cf..b5bcaa2 100644 --- a/git-codereview/change.go +++ b/git-codereview/change.go @@ -14,7 +14,7 @@ import ( var changeAuto bool var changeQuick bool -func change(args []string) { +func cmdChange(args []string) { flags.BoolVar(&changeAuto, "a", false, "add changes to any tracked files") flags.BoolVar(&changeQuick, "q", false, "do not edit pending commit msg") flags.Parse(args) diff --git a/git-codereview/gofmt.go b/git-codereview/gofmt.go index 4608a3a..5c3780e 100644 --- a/git-codereview/gofmt.go +++ b/git-codereview/gofmt.go @@ -17,7 +17,7 @@ import ( var gofmtList bool -func gofmt(args []string) { +func cmdGofmt(args []string) { flags.BoolVar(&gofmtList, "l", false, "list files that need to be formatted") flags.Parse(args) if len(flag.Args()) > 0 { diff --git a/git-codereview/hook.go b/git-codereview/hook.go index ae6a6cd..63163d6 100644 --- a/git-codereview/hook.go +++ b/git-codereview/hook.go @@ -97,7 +97,7 @@ var oldHookScript = `#!/bin/sh exec git-review hook-invoke %s "$@" ` -func hookInvoke(args []string) { +func cmdHookInvoke(args []string) { if len(args) == 0 { dief("usage: git-codereview hook-invoke <hook-name> [args...]") } diff --git a/git-codereview/mail.go b/git-codereview/mail.go index a68cdea..3eabd47 100644 --- a/git-codereview/mail.go +++ b/git-codereview/mail.go @@ -12,7 +12,7 @@ import ( "strings" ) -func mail(args []string) { +func cmdMail(args []string) { var ( diff = flags.Bool("diff", false, "show change commit diff and don't upload or mail") force = flags.Bool("f", false, "mail even if there are staged changes") diff --git a/git-codereview/pending.go b/git-codereview/pending.go index 3239d23..deda834 100644 --- a/git-codereview/pending.go +++ b/git-codereview/pending.go @@ -52,7 +52,7 @@ func (b *pendingBranch) load() { } } -func pending(args []string) { +func cmdPending(args []string) { flags.BoolVar(&pendingCurrentOnly, "c", false, "show only current branch") flags.BoolVar(&pendingLocal, "l", false, "use only local information - no network operations") flags.BoolVar(&pendingShort, "s", false, "show short listing") diff --git a/git-codereview/review.go b/git-codereview/review.go index 144f911..bc13a41 100644 --- a/git-codereview/review.go +++ b/git-codereview/review.go @@ -127,25 +127,25 @@ func main() { switch command { case "branchpoint": - branchpoint(args) + cmdBranchpoint(args) case "change": - change(args) + cmdChange(args) case "gofmt": - gofmt(args) + cmdGofmt(args) case "hook-invoke": - hookInvoke(args) + cmdHookInvoke(args) case "hooks": // done - installHook already ran case "mail", "m": - mail(args) + cmdMail(args) case "pending": - pending(args) + cmdPending(args) case "rebase-work": - rebasework(args) + cmdRebasework(args) case "submit": - submit(args) + cmdSubmit(args) case "sync": - doSync(args) + cmdSync(args) case "test-loadAuth": // for testing only loadAuth() default: diff --git a/git-codereview/submit.go b/git-codereview/submit.go index a50b214..8528641 100644 --- a/git-codereview/submit.go +++ b/git-codereview/submit.go @@ -12,7 +12,7 @@ import ( // TODO(rsc): Add -tbr, along with standard exceptions (doc/go1.5.txt) -func submit(args []string) { +func cmdSubmit(args []string) { flags.Usage = func() { fmt.Fprintf(stderr(), "Usage: %s submit %s [commit-hash]\n", os.Args[0], globalFlags) } diff --git a/git-codereview/sync.go b/git-codereview/sync.go index 652b0bf..59611ac 100644 --- a/git-codereview/sync.go +++ b/git-codereview/sync.go @@ -6,7 +6,7 @@ package main import "strings" -func doSync(args []string) { +func cmdSync(args []string) { expectZeroArgs(args, "sync") // Get current branch and commit ID for fixup after pull. |
