Merge pull request #4112 from cli/extension-cmd-rename
Rename `gh extensions` → `gh extension`
This commit is contained in:
commit
fbe1487dd0
9 changed files with 16 additions and 15 deletions
|
|
@ -1,4 +1,4 @@
|
|||
package extensions
|
||||
package extension
|
||||
|
||||
import (
|
||||
"errors"
|
||||
|
|
@ -15,12 +15,12 @@ import (
|
|||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
func NewCmdExtensions(f *cmdutil.Factory) *cobra.Command {
|
||||
func NewCmdExtension(f *cmdutil.Factory) *cobra.Command {
|
||||
m := f.ExtensionManager
|
||||
io := f.IOStreams
|
||||
|
||||
extCmd := cobra.Command{
|
||||
Use: "extensions",
|
||||
Use: "extension",
|
||||
Short: "Manage gh extensions",
|
||||
Long: heredoc.Docf(`
|
||||
GitHub CLI extensions are repositories that provide additional gh commands.
|
||||
|
|
@ -31,6 +31,7 @@ func NewCmdExtensions(f *cmdutil.Factory) *cobra.Command {
|
|||
|
||||
An extension cannot override any of the core gh commands.
|
||||
`, "`"),
|
||||
Aliases: []string{"extensions"},
|
||||
}
|
||||
|
||||
extCmd.AddCommand(
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package extensions
|
||||
package extension
|
||||
|
||||
import (
|
||||
"io"
|
||||
|
|
@ -15,7 +15,7 @@ import (
|
|||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestNewCmdExtensions(t *testing.T) {
|
||||
func TestNewCmdExtension(t *testing.T) {
|
||||
tempDir := t.TempDir()
|
||||
oldWd, _ := os.Getwd()
|
||||
assert.NoError(t, os.Chdir(tempDir))
|
||||
|
|
@ -183,7 +183,7 @@ func TestNewCmdExtensions(t *testing.T) {
|
|||
ExtensionManager: em,
|
||||
}
|
||||
|
||||
cmd := NewCmdExtensions(&f)
|
||||
cmd := NewCmdExtension(&f)
|
||||
cmd.SetArgs(tt.args)
|
||||
cmd.SetOut(ioutil.Discard)
|
||||
cmd.SetErr(ioutil.Discard)
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package extensions
|
||||
package extension
|
||||
|
||||
import (
|
||||
"path/filepath"
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package extensions
|
||||
package extension
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package extensions
|
||||
package extension
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
// +build !windows
|
||||
|
||||
package extensions
|
||||
package extension
|
||||
|
||||
import "os"
|
||||
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package extensions
|
||||
package extension
|
||||
|
||||
import "os"
|
||||
|
||||
|
|
@ -11,7 +11,7 @@ import (
|
|||
"github.com/cli/cli/git"
|
||||
"github.com/cli/cli/internal/config"
|
||||
"github.com/cli/cli/internal/ghrepo"
|
||||
"github.com/cli/cli/pkg/cmd/extensions"
|
||||
"github.com/cli/cli/pkg/cmd/extension"
|
||||
"github.com/cli/cli/pkg/cmdutil"
|
||||
"github.com/cli/cli/pkg/iostreams"
|
||||
)
|
||||
|
|
@ -22,7 +22,7 @@ func New(appVersion string) *cmdutil.Factory {
|
|||
Branch: branchFunc(), // No factory dependencies
|
||||
Executable: executable(), // No factory dependencies
|
||||
|
||||
ExtensionManager: extensions.NewManager(),
|
||||
ExtensionManager: extension.NewManager(),
|
||||
}
|
||||
|
||||
f.IOStreams = ioStreams(f) // Depends on Config
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import (
|
|||
browseCmd "github.com/cli/cli/pkg/cmd/browse"
|
||||
completionCmd "github.com/cli/cli/pkg/cmd/completion"
|
||||
configCmd "github.com/cli/cli/pkg/cmd/config"
|
||||
extensionsCmd "github.com/cli/cli/pkg/cmd/extensions"
|
||||
extensionCmd "github.com/cli/cli/pkg/cmd/extension"
|
||||
"github.com/cli/cli/pkg/cmd/factory"
|
||||
gistCmd "github.com/cli/cli/pkg/cmd/gist"
|
||||
issueCmd "github.com/cli/cli/pkg/cmd/issue"
|
||||
|
|
@ -75,7 +75,7 @@ func NewCmdRoot(f *cmdutil.Factory, version, buildDate string) *cobra.Command {
|
|||
cmd.AddCommand(creditsCmd.NewCmdCredits(f, nil))
|
||||
cmd.AddCommand(gistCmd.NewCmdGist(f))
|
||||
cmd.AddCommand(completionCmd.NewCmdCompletion(f.IOStreams))
|
||||
cmd.AddCommand(extensionsCmd.NewCmdExtensions(f))
|
||||
cmd.AddCommand(extensionCmd.NewCmdExtension(f))
|
||||
cmd.AddCommand(secretCmd.NewCmdSecret(f))
|
||||
cmd.AddCommand(sshKeyCmd.NewCmdSSHKey(f))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue