ctr version: add args check, prohibit incoming args

Signed-off-by: helen <haitao.zhang@daocloud.io>
This commit is contained in:
helen 2023-02-13 17:20:10 +08:00
parent 2654ece1d0
commit 36e7dbdcbd

View File

@ -30,6 +30,10 @@ var Command = cli.Command{
Name: "version",
Usage: "Print the client and server versions",
Action: func(context *cli.Context) error {
if context.NArg() != 0 {
return fmt.Errorf("extra arguments: %v", context.Args())
}
fmt.Println("Client:")
fmt.Println(" Version: ", version.Version)
fmt.Println(" Revision:", version.Revision)