github.com/ungtb10d/cli/v2@v2.0.0-20221110210412-98537dd9d6a1/pkg/cmd/alias/alias.go (about)

     1  package alias
     2  
     3  import (
     4  	"github.com/MakeNowJust/heredoc"
     5  	deleteCmd "github.com/ungtb10d/cli/v2/pkg/cmd/alias/delete"
     6  	listCmd "github.com/ungtb10d/cli/v2/pkg/cmd/alias/list"
     7  	setCmd "github.com/ungtb10d/cli/v2/pkg/cmd/alias/set"
     8  	"github.com/ungtb10d/cli/v2/pkg/cmdutil"
     9  	"github.com/spf13/cobra"
    10  )
    11  
    12  func NewCmdAlias(f *cmdutil.Factory) *cobra.Command {
    13  	cmd := &cobra.Command{
    14  		Use:   "alias <command>",
    15  		Short: "Create command shortcuts",
    16  		Long: heredoc.Doc(`
    17  			Aliases can be used to make shortcuts for gh commands or to compose multiple commands.
    18  
    19  			Run "gh help alias set" to learn more.
    20  		`),
    21  	}
    22  
    23  	cmdutil.DisableAuthCheck(cmd)
    24  
    25  	cmd.AddCommand(deleteCmd.NewCmdDelete(f, nil))
    26  	cmd.AddCommand(listCmd.NewCmdList(f, nil))
    27  	cmd.AddCommand(setCmd.NewCmdSet(f, nil))
    28  
    29  	return cmd
    30  }