Use spf13/cobra for docker commit

This fix is part of the effort to convert commands to spf13/cobra #23211.

Thif fix coverted command `docker commit` to use spf13/cobra

NOTE: `RequiresMinMaxArgs()` has been renamed to `RequiresRangeArgs()`.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
This commit is contained in:
Yong Tang
2016-06-06 07:57:44 -07:00
parent 58a97cc11e
commit 43fdd6f2fa
3 changed files with 3 additions and 3 deletions

View File

@ -60,8 +60,8 @@ func RequiresMaxArgs(max int) cobra.PositionalArgs {
}
}
// RequiresMinMaxArgs returns an error if there is not at least min args and at most max args
func RequiresMinMaxArgs(min int, max int) cobra.PositionalArgs {
// RequiresRangeArgs returns an error if there is not at least min args and at most max args
func RequiresRangeArgs(min int, max int) cobra.PositionalArgs {
return func(cmd *cobra.Command, args []string) error {
if len(args) >= min && len(args) <= max {
return nil