minor fix in base repo functionality
This commit is contained in:
parent
48baf50b8e
commit
b0dce5b04d
1 changed files with 3 additions and 6 deletions
|
|
@ -35,20 +35,17 @@ func NewCmdArchive(f *cmdutil.Factory, runF func(*ArchiveOptions) error) *cobra.
|
|||
}
|
||||
|
||||
cmd := &cobra.Command{
|
||||
Use: "archive [<repository>]",
|
||||
Use: "archive",
|
||||
Short: "Archive a repository",
|
||||
Long: heredoc.Doc(`Archive a GitHub repository.
|
||||
|
||||
With no argument, archives the current repository.`),
|
||||
Args: cobra.MaximumNArgs(1),
|
||||
Args: cobra.MaximumNArgs(0),
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
if len(args) > 0 {
|
||||
opts.RepoArg = args[0]
|
||||
}
|
||||
opts.BaseRepo = f.BaseRepo
|
||||
opts.HasRepoOverride = cmd.Flags().Changed("repo")
|
||||
|
||||
if !opts.Confirmed && !opts.IO.CanPrompt() {
|
||||
if !opts.Confirmed && !opts.IO.CanPrompt() && !opts.HasRepoOverride {
|
||||
return cmdutil.FlagErrorf("could not prompt: confirmation with prompt or --confirm flag required")
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue