Skip to content

Commit 29c61ba

Browse files
committed
rename to protip
1 parent 8bf3f55 commit 29c61ba

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package tip
1+
package protip
22

33
import (
44
"fmt"
@@ -8,35 +8,35 @@ import (
88
"github.com/spf13/cobra"
99
)
1010

11-
type TipOptions struct {
11+
type ProtipOptions struct {
1212
IO *iostreams.IOStreams
1313

1414
Character string
1515
}
1616

17-
func NewCmdTip(f *cmdutil.Factory, runF func(*TipOptions) error) *cobra.Command {
18-
opts := &TipOptions{
17+
func NewCmdProtip(f *cmdutil.Factory, runF func(*ProtipOptions) error) *cobra.Command {
18+
opts := &ProtipOptions{
1919
IO: f.IOStreams,
2020
}
2121

2222
cmd := &cobra.Command{
23-
Use: "tip",
24-
Short: "get a random tip about using gh",
23+
Use: "protip",
24+
Short: "get a random protip about using gh",
2525
Args: cobra.NoArgs,
2626
RunE: func(cmd *cobra.Command, args []string) error {
2727
if runF != nil {
2828
return runF(opts)
2929
}
30-
return tipRun(opts)
30+
return protipRun(opts)
3131
},
3232
}
3333

34-
cmd.Flags().StringVarP(&opts.Character, "character", "c", "clippy", "What helpful animated character you'd like a tip from")
34+
cmd.Flags().StringVarP(&opts.Character, "character", "c", "clippy", "What helpful animated character you'd like a protip from")
3535

3636
return cmd
3737
}
3838

39-
func tipRun(opts *TipOptions) error {
39+
func protipRun(opts *ProtipOptions) error {
4040
fmt.Println("hey")
4141
return nil
4242
}

pkg/cmd/root/root.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ import (
1616
gistCmd "github.com/cli/cli/pkg/cmd/gist"
1717
issueCmd "github.com/cli/cli/pkg/cmd/issue"
1818
prCmd "github.com/cli/cli/pkg/cmd/pr"
19+
protipCmd "github.com/cli/cli/pkg/cmd/protip"
1920
releaseCmd "github.com/cli/cli/pkg/cmd/release"
2021
repoCmd "github.com/cli/cli/pkg/cmd/repo"
2122
creditsCmd "github.com/cli/cli/pkg/cmd/repo/credits"
22-
tipCmd "github.com/cli/cli/pkg/cmd/tip"
2323
versionCmd "github.com/cli/cli/pkg/cmd/version"
2424
"github.com/cli/cli/pkg/cmdutil"
2525
"github.com/spf13/cobra"
@@ -69,7 +69,7 @@ func NewCmdRoot(f *cmdutil.Factory, version, buildDate string) *cobra.Command {
6969
cmd.AddCommand(creditsCmd.NewCmdCredits(f, nil))
7070
cmd.AddCommand(gistCmd.NewCmdGist(f))
7171
cmd.AddCommand(completionCmd.NewCmdCompletion(f.IOStreams))
72-
cmd.AddCommand(tipCmd.NewCmdTip(f, nil))
72+
cmd.AddCommand(protipCmd.NewCmdProtip(f, nil))
7373

7474
// the `api` command should not inherit any extra HTTP headers
7575
bareHTTPCmdFactory := *f

0 commit comments

Comments
 (0)