Add "new" alias to "create" commands (#5388)
Co-authored-by: Mislav Marohnić <mislav@github.com>
This commit is contained in:
parent
8a0c1f903c
commit
933a91e18e
5 changed files with 8 additions and 3 deletions
|
|
@ -86,6 +86,7 @@ func NewCmdCreate(f *cmdutil.Factory, runF func(*CreateOptions) error) *cobra.Co
|
|||
}
|
||||
return nil
|
||||
},
|
||||
Aliases: []string{"new"},
|
||||
RunE: func(c *cobra.Command, args []string) error {
|
||||
opts.Filenames = args
|
||||
|
||||
|
|
|
|||
|
|
@ -64,7 +64,8 @@ func NewCmdCreate(f *cmdutil.Factory, runF func(*CreateOptions) error) *cobra.Co
|
|||
$ gh issue create --assignee "@me"
|
||||
$ gh issue create --project "Roadmap"
|
||||
`),
|
||||
Args: cmdutil.NoArgsQuoteReminder,
|
||||
Args: cmdutil.NoArgsQuoteReminder,
|
||||
Aliases: []string{"new"},
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
// support `-R, --repo` override
|
||||
opts.BaseRepo = f.BaseRepo
|
||||
|
|
|
|||
|
|
@ -116,7 +116,8 @@ func NewCmdCreate(f *cmdutil.Factory, runF func(*CreateOptions) error) *cobra.Co
|
|||
$ gh pr create --project "Roadmap"
|
||||
$ gh pr create --base develop --head monalisa:feature
|
||||
`),
|
||||
Args: cmdutil.NoArgsQuoteReminder,
|
||||
Args: cmdutil.NoArgsQuoteReminder,
|
||||
Aliases: []string{"new"},
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
opts.Finder = shared.NewFinder(f)
|
||||
|
||||
|
|
|
|||
|
|
@ -109,6 +109,7 @@ func NewCmdCreate(f *cmdutil.Factory, runF func(*CreateOptions) error) *cobra.Co
|
|||
Create a release and start a discussion
|
||||
$ gh release create v1.2.3 --discussion-category "General"
|
||||
`),
|
||||
Aliases: []string{"new"},
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
if cmd.Flags().Changed("discussion-category") && opts.Draft {
|
||||
return errors.New("discussions for draft releases not supported")
|
||||
|
|
|
|||
|
|
@ -82,7 +82,8 @@ func NewCmdCreate(f *cmdutil.Factory, runF func(*CreateOptions) error) *cobra.Co
|
|||
# create a remote repository from the current directory
|
||||
gh repo create my-project --private --source=. --remote=upstream
|
||||
`),
|
||||
Args: cobra.MaximumNArgs(1),
|
||||
Args: cobra.MaximumNArgs(1),
|
||||
Aliases: []string{"new"},
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
if len(args) > 0 {
|
||||
opts.Name = args[0]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue