@@ -53,20 +53,20 @@ func (c *AppScriptGetCmd) Run(ctx context.Context, flags *RootFlags) error {
5353 }
5454
5555 u := ui .FromContext (ctx )
56- u .Out ().Printf ("script_id\t %s" , project .ScriptId )
56+ u .Out ().Linef ("script_id\t %s" , project .ScriptId )
5757 if project .Title != "" {
58- u .Out ().Printf ("title\t %s" , project .Title )
58+ u .Out ().Linef ("title\t %s" , project .Title )
5959 }
6060 if project .ParentId != "" {
61- u .Out ().Printf ("parent_id\t %s" , project .ParentId )
61+ u .Out ().Linef ("parent_id\t %s" , project .ParentId )
6262 }
6363 if project .CreateTime != "" {
64- u .Out ().Printf ("created\t %s" , project .CreateTime )
64+ u .Out ().Linef ("created\t %s" , project .CreateTime )
6565 }
6666 if project .UpdateTime != "" {
67- u .Out ().Printf ("updated\t %s" , project .UpdateTime )
67+ u .Out ().Linef ("updated\t %s" , project .UpdateTime )
6868 }
69- u .Out ().Printf ("editor_url\t %s" , appScriptEditURL (scriptID ))
69+ u .Out ().Linef ("editor_url\t %s" , appScriptEditURL (scriptID ))
7070 return nil
7171}
7272
@@ -100,13 +100,13 @@ func (c *AppScriptContentCmd) Run(ctx context.Context, flags *RootFlags) error {
100100 }
101101
102102 u := ui .FromContext (ctx )
103- u .Out ().Printf ("script_id\t %s" , content .ScriptId )
104- u .Out ().Printf ("files\t %d" , len (content .Files ))
103+ u .Out ().Linef ("script_id\t %s" , content .ScriptId )
104+ u .Out ().Linef ("files\t %d" , len (content .Files ))
105105 for _ , file := range content .Files {
106106 if file == nil {
107107 continue
108108 }
109- u .Out ().Printf ("file\t %s\t %s" , file .Name , file .Type )
109+ u .Out ().Linef ("file\t %s\t %s" , file .Name , file .Type )
110110 }
111111 return nil
112112}
@@ -157,21 +157,21 @@ func (c *AppScriptRunCmd) Run(ctx context.Context, flags *RootFlags) error {
157157 }
158158
159159 u := ui .FromContext (ctx )
160- u .Out ().Printf ("done\t %t" , op .Done )
160+ u .Out ().Linef ("done\t %t" , op .Done )
161161
162162 if op .Error != nil {
163163 if op .Error .Code != 0 {
164- u .Out ().Printf ("error_code\t %d" , op .Error .Code )
164+ u .Out ().Linef ("error_code\t %d" , op .Error .Code )
165165 }
166166 if op .Error .Message != "" {
167- u .Out ().Printf ("error\t %s" , op .Error .Message )
167+ u .Out ().Linef ("error\t %s" , op .Error .Message )
168168 }
169169 if detail := parseExecutionError (op .Error ); detail != nil {
170170 if detail .ErrorType != "" {
171- u .Out ().Printf ("error_type\t %s" , detail .ErrorType )
171+ u .Out ().Linef ("error_type\t %s" , detail .ErrorType )
172172 }
173173 if detail .ErrorMessage != "" {
174- u .Out ().Printf ("error_message\t %s" , detail .ErrorMessage )
174+ u .Out ().Linef ("error_message\t %s" , detail .ErrorMessage )
175175 }
176176 }
177177 return nil
@@ -181,7 +181,7 @@ func (c *AppScriptRunCmd) Run(ctx context.Context, flags *RootFlags) error {
181181 var execResp scriptapi.ExecutionResponse
182182 if err := json .Unmarshal (op .Response , & execResp ); err == nil && execResp .Result != nil {
183183 if b , marshalErr := json .Marshal (execResp .Result ); marshalErr == nil {
184- u .Out ().Printf ("result\t %s" , string (b ))
184+ u .Out ().Linef ("result\t %s" , string (b ))
185185 }
186186 }
187187 }
@@ -233,15 +233,15 @@ func (c *AppScriptCreateCmd) Run(ctx context.Context, flags *RootFlags) error {
233233 }
234234
235235 u := ui .FromContext (ctx )
236- u .Out ().Printf ("created\t true" )
237- u .Out ().Printf ("script_id\t %s" , project .ScriptId )
236+ u .Out ().Linef ("created\t true" )
237+ u .Out ().Linef ("script_id\t %s" , project .ScriptId )
238238 if project .Title != "" {
239- u .Out ().Printf ("title\t %s" , project .Title )
239+ u .Out ().Linef ("title\t %s" , project .Title )
240240 }
241241 if project .ParentId != "" {
242- u .Out ().Printf ("parent_id\t %s" , project .ParentId )
242+ u .Out ().Linef ("parent_id\t %s" , project .ParentId )
243243 }
244- u .Out ().Printf ("editor_url\t %s" , appScriptEditURL (project .ScriptId ))
244+ u .Out ().Linef ("editor_url\t %s" , appScriptEditURL (project .ScriptId ))
245245 return nil
246246}
247247
0 commit comments