Skip to content

Commit b0fe1be

Browse files
committed
subcommand: rename 'subcommand()' to 'Name()'
Change the 'Subcommand' interface's 'subcommand()' to 'Name()' to clarify what that the function is intended to return the name of the subcommand (as it would be used on the command line). Additionally, by capitalizing the function name, make it public to other packages; this will be necessary in later patches when the interface is moved to a new package. Signed-off-by: Victoria Dye <[email protected]>
1 parent 9429f14 commit b0fe1be

File tree

8 files changed

+8
-8
lines changed

8 files changed

+8
-8
lines changed

cmd/git-bundle-server/delete.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99

1010
type Delete struct{}
1111

12-
func (Delete) subcommand() string {
12+
func (Delete) Name() string {
1313
return "delete"
1414
}
1515

cmd/git-bundle-server/init.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111

1212
type Init struct{}
1313

14-
func (Init) subcommand() string {
14+
func (Init) Name() string {
1515
return "init"
1616
}
1717

cmd/git-bundle-server/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ func main() {
1414
}
1515

1616
for i := 0; i < len(cmds); i++ {
17-
if cmds[i].subcommand() == os.Args[1] {
17+
if cmds[i].Name() == os.Args[1] {
1818
err := cmds[i].run(os.Args[2:])
1919
if err != nil {
2020
log.Fatal("Failed with error: ", err)

cmd/git-bundle-server/start.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010

1111
type Start struct{}
1212

13-
func (Start) subcommand() string {
13+
func (Start) Name() string {
1414
return "start"
1515
}
1616

cmd/git-bundle-server/stop.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88

99
type Stop struct{}
1010

11-
func (Stop) subcommand() string {
11+
func (Stop) Name() string {
1212
return "stop"
1313
}
1414

cmd/git-bundle-server/subcommand.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package main
22

33
type Subcommand interface {
4-
subcommand() string
4+
Name() string
55
run(args []string) error
66
}
77

cmd/git-bundle-server/update-all.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010

1111
type UpdateAll struct{}
1212

13-
func (UpdateAll) subcommand() string {
13+
func (UpdateAll) Name() string {
1414
return "update-all"
1515
}
1616

cmd/git-bundle-server/update.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010

1111
type Update struct{}
1212

13-
func (Update) subcommand() string {
13+
func (Update) Name() string {
1414
return "update"
1515
}
1616

0 commit comments

Comments
 (0)