File: alias.go

package info (click to toggle)
gh 2.46.0-4
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 15,548 kB
  • sloc: sh: 227; makefile: 117
file content (32 lines) | stat: -rw-r--r-- 890 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package alias

import (
	"github.com/MakeNowJust/heredoc"
	deleteCmd "github.com/cli/cli/v2/pkg/cmd/alias/delete"
	importCmd "github.com/cli/cli/v2/pkg/cmd/alias/imports"
	listCmd "github.com/cli/cli/v2/pkg/cmd/alias/list"
	setCmd "github.com/cli/cli/v2/pkg/cmd/alias/set"
	"github.com/cli/cli/v2/pkg/cmdutil"
	"github.com/spf13/cobra"
)

func NewCmdAlias(f *cmdutil.Factory) *cobra.Command {
	cmd := &cobra.Command{
		Use:   "alias <command>",
		Short: "Create command shortcuts",
		Long: heredoc.Docf(`
			Aliases can be used to make shortcuts for gh commands or to compose multiple commands.

			Run %[1]sgh help alias set%[1]s to learn more.
		`, "`"),
	}

	cmdutil.DisableAuthCheck(cmd)

	cmd.AddCommand(deleteCmd.NewCmdDelete(f, nil))
	cmd.AddCommand(importCmd.NewCmdImport(f, nil))
	cmd.AddCommand(listCmd.NewCmdList(f, nil))
	cmd.AddCommand(setCmd.NewCmdSet(f, nil))

	return cmd
}