refactor: use ExactArgs instead of MaximumNArgs

This commit is contained in:
Wing-Kam Wong 2023-03-23 11:52:14 +08:00
parent 5699daef27
commit 951d1aaa1f

View file

@ -38,7 +38,7 @@ func NewCmdRename(f *cmdutil.Factory, runf func(*RenameOptions) error) *cobra.Co
Use: "rename {<id> | <url>} <oldFilename> <newFilename>",
Short: "Rename a file in a gist",
Long: heredoc.Doc(`Rename a file in the given gist ID / URL.`),
Args: cobra.MaximumNArgs(3),
Args: cobra.ExactArgs(3),
RunE: func(cmd *cobra.Command, args []string) error {
if len(args) == 3 {
opts.Selector = args[0]