X Tutup
Skip to content

Commit fbe1487

Browse files
authored
Merge pull request cli#4112 from cli/extension-cmd-rename
Rename `gh extensions` → `gh extension`
2 parents 0c99f7d + bf9c49e commit fbe1487

File tree

9 files changed

+16
-15
lines changed

9 files changed

+16
-15
lines changed
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package extensions
1+
package extension
22

33
import (
44
"errors"
@@ -15,12 +15,12 @@ import (
1515
"github.com/spf13/cobra"
1616
)
1717

18-
func NewCmdExtensions(f *cmdutil.Factory) *cobra.Command {
18+
func NewCmdExtension(f *cmdutil.Factory) *cobra.Command {
1919
m := f.ExtensionManager
2020
io := f.IOStreams
2121

2222
extCmd := cobra.Command{
23-
Use: "extensions",
23+
Use: "extension",
2424
Short: "Manage gh extensions",
2525
Long: heredoc.Docf(`
2626
GitHub CLI extensions are repositories that provide additional gh commands.
@@ -31,6 +31,7 @@ func NewCmdExtensions(f *cmdutil.Factory) *cobra.Command {
3131
3232
An extension cannot override any of the core gh commands.
3333
`, "`"),
34+
Aliases: []string{"extensions"},
3435
}
3536

3637
extCmd.AddCommand(
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package extensions
1+
package extension
22

33
import (
44
"io"
@@ -15,7 +15,7 @@ import (
1515
"github.com/stretchr/testify/assert"
1616
)
1717

18-
func TestNewCmdExtensions(t *testing.T) {
18+
func TestNewCmdExtension(t *testing.T) {
1919
tempDir := t.TempDir()
2020
oldWd, _ := os.Getwd()
2121
assert.NoError(t, os.Chdir(tempDir))
@@ -183,7 +183,7 @@ func TestNewCmdExtensions(t *testing.T) {
183183
ExtensionManager: em,
184184
}
185185

186-
cmd := NewCmdExtensions(&f)
186+
cmd := NewCmdExtension(&f)
187187
cmd.SetArgs(tt.args)
188188
cmd.SetOut(ioutil.Discard)
189189
cmd.SetErr(ioutil.Discard)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package extensions
1+
package extension
22

33
import (
44
"path/filepath"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package extensions
1+
package extension
22

33
import (
44
"bytes"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package extensions
1+
package extension
22

33
import (
44
"bytes"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// +build !windows
22

3-
package extensions
3+
package extension
44

55
import "os"
66

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package extensions
1+
package extension
22

33
import "os"
44

pkg/cmd/factory/default.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
"github.com/cli/cli/git"
1212
"github.com/cli/cli/internal/config"
1313
"github.com/cli/cli/internal/ghrepo"
14-
"github.com/cli/cli/pkg/cmd/extensions"
14+
"github.com/cli/cli/pkg/cmd/extension"
1515
"github.com/cli/cli/pkg/cmdutil"
1616
"github.com/cli/cli/pkg/iostreams"
1717
)
@@ -22,7 +22,7 @@ func New(appVersion string) *cmdutil.Factory {
2222
Branch: branchFunc(), // No factory dependencies
2323
Executable: executable(), // No factory dependencies
2424

25-
ExtensionManager: extensions.NewManager(),
25+
ExtensionManager: extension.NewManager(),
2626
}
2727

2828
f.IOStreams = ioStreams(f) // Depends on Config

pkg/cmd/root/root.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
browseCmd "github.com/cli/cli/pkg/cmd/browse"
1212
completionCmd "github.com/cli/cli/pkg/cmd/completion"
1313
configCmd "github.com/cli/cli/pkg/cmd/config"
14-
extensionsCmd "github.com/cli/cli/pkg/cmd/extensions"
14+
extensionCmd "github.com/cli/cli/pkg/cmd/extension"
1515
"github.com/cli/cli/pkg/cmd/factory"
1616
gistCmd "github.com/cli/cli/pkg/cmd/gist"
1717
issueCmd "github.com/cli/cli/pkg/cmd/issue"
@@ -75,7 +75,7 @@ func NewCmdRoot(f *cmdutil.Factory, version, buildDate string) *cobra.Command {
7575
cmd.AddCommand(creditsCmd.NewCmdCredits(f, nil))
7676
cmd.AddCommand(gistCmd.NewCmdGist(f))
7777
cmd.AddCommand(completionCmd.NewCmdCompletion(f.IOStreams))
78-
cmd.AddCommand(extensionsCmd.NewCmdExtensions(f))
78+
cmd.AddCommand(extensionCmd.NewCmdExtension(f))
7979
cmd.AddCommand(secretCmd.NewCmdSecret(f))
8080
cmd.AddCommand(sshKeyCmd.NewCmdSSHKey(f))
8181

0 commit comments

Comments
 (0)
X Tutup