mirror of
https://github.com/opencontainers/runc.git
synced 2025-11-03 09:51:06 +08:00
kill: requires max 2 arguments
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
5
utils.go
5
utils.go
@@ -13,6 +13,7 @@ import (
|
||||
const (
|
||||
exactArgs = iota
|
||||
minArgs
|
||||
maxArgs
|
||||
)
|
||||
|
||||
func checkArgs(context *cli.Context, expected, checkType int) error {
|
||||
@@ -27,6 +28,10 @@ func checkArgs(context *cli.Context, expected, checkType int) error {
|
||||
if context.NArg() < expected {
|
||||
err = fmt.Errorf("%s: %q requires a minimum of %d argument(s)", os.Args[0], cmdName, expected)
|
||||
}
|
||||
case maxArgs:
|
||||
if context.NArg() > expected {
|
||||
err = fmt.Errorf("%s: %q requires a maximum of %d argument(s)", os.Args[0], cmdName, expected)
|
||||
}
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user