From 305b95564167e1949222a04f8885c4ba84bf4b1e Mon Sep 17 00:00:00 2001 From: TangBin Date: Tue, 30 Jul 2019 11:12:27 +0800 Subject: [PATCH] copyright update climc fix --- cmd/climc/shell/copyright.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/cmd/climc/shell/copyright.go b/cmd/climc/shell/copyright.go index cea770cd47..a13a547b5f 100644 --- a/cmd/climc/shell/copyright.go +++ b/cmd/climc/shell/copyright.go @@ -24,9 +24,9 @@ import ( func init() { type CopyrightUpdateOptions struct { - Copyright string `help:"The copyright"` - Email string `help:"The Email"` - Docs string `help:"the Docs website address" required:"true"` + Copyright string `help:"The copyright"` + Email string `help:"The Email"` + Docs *string `help:"the Docs website address"` } R(&CopyrightUpdateOptions{}, "copyright-update", "update copyright", func(s *mcclient.ClientSession, args *CopyrightUpdateOptions) error { @@ -35,7 +35,10 @@ func init() { } params := jsonutils.NewDict() - params.Add(jsonutils.NewString(args.Docs), "docs") + if args.Docs != nil { + params.Add(jsonutils.NewString(*args.Docs), "docs") + } + if len(args.Copyright) > 0 { params.Add(jsonutils.NewString(args.Copyright), "copyright") }