ctr version: add args check, prohibit incoming args
Signed-off-by: helen <haitao.zhang@daocloud.io>
This commit is contained in:
parent
2654ece1d0
commit
36e7dbdcbd
@ -30,6 +30,10 @@ var Command = cli.Command{
|
|||||||
Name: "version",
|
Name: "version",
|
||||||
Usage: "Print the client and server versions",
|
Usage: "Print the client and server versions",
|
||||||
Action: func(context *cli.Context) error {
|
Action: func(context *cli.Context) error {
|
||||||
|
if context.NArg() != 0 {
|
||||||
|
return fmt.Errorf("extra arguments: %v", context.Args())
|
||||||
|
}
|
||||||
|
|
||||||
fmt.Println("Client:")
|
fmt.Println("Client:")
|
||||||
fmt.Println(" Version: ", version.Version)
|
fmt.Println(" Version: ", version.Version)
|
||||||
fmt.Println(" Revision:", version.Revision)
|
fmt.Println(" Revision:", version.Revision)
|
||||||
|
Loading…
Reference in New Issue
Block a user