Merge pull request #4112 from cli/extension-cmd-rename

Rename `gh extensions` → `gh extension`
This commit is contained in:
Mislav Marohnić 2021-08-12 15:35:01 +02:00 committed by GitHub
commit fbe1487dd0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 16 additions and 15 deletions

View file

@ -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(

View file

@ -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)

View file

@ -1,4 +1,4 @@
package extensions
package extension
import (
"path/filepath"

View file

@ -1,4 +1,4 @@
package extensions
package extension
import (
"bytes"

View file

@ -1,4 +1,4 @@
package extensions
package extension
import (
"bytes"

View file

@ -1,6 +1,6 @@
// +build !windows
package extensions
package extension
import "os"

View file

@ -1,4 +1,4 @@
package extensions
package extension
import "os"

View file

@ -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

View file

@ -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))