@@ -83,8 +83,9 @@ func PreprocessSketchWithCtags(
83
83
}
84
84
85
85
// Run CTags on gcc-preprocessed source
86
- ctagsOutput , ctagsStdErr , err := RunCTags (ctx , ctagsTarget , buildProperties )
86
+ ctagsOutput , ctagsStdErr , ctagsCmdLine , err := RunCTags (ctx , ctagsTarget , buildProperties )
87
87
if verbose {
88
+ stdout .Write ([]byte (ctagsCmdLine + "\n " ))
88
89
stderr .Write (ctagsStdErr )
89
90
}
90
91
if err != nil {
@@ -178,7 +179,7 @@ func isFirstFunctionOutsideOfSource(firstFunctionLine int, sourceRows []string)
178
179
}
179
180
180
181
// RunCTags performs a run of ctags on the given source file. Returns the ctags output and the stderr contents.
181
- func RunCTags (ctx context.Context , sourceFile * paths.Path , buildProperties * properties.Map ) ([]byte , []byte , error ) {
182
+ func RunCTags (ctx context.Context , sourceFile * paths.Path , buildProperties * properties.Map ) ([]byte , []byte , string , error ) {
182
183
ctagsBuildProperties := properties .NewMap ()
183
184
ctagsBuildProperties .Set ("tools.ctags.path" , "{runtime.tools.ctags.path}" )
184
185
ctagsBuildProperties .Set ("tools.ctags.cmd.path" , "{path}/ctags" )
@@ -189,24 +190,22 @@ func RunCTags(ctx context.Context, sourceFile *paths.Path, buildProperties *prop
189
190
190
191
pattern := ctagsBuildProperties .Get ("pattern" )
191
192
if pattern == "" {
192
- return nil , nil , errors .New (i18n .Tr ("%s pattern is missing" , "ctags" ))
193
+ return nil , nil , "" , errors .New (i18n .Tr ("%s pattern is missing" , "ctags" ))
193
194
}
194
195
195
196
commandLine := ctagsBuildProperties .ExpandPropsInString (pattern )
196
197
parts , err := properties .SplitQuotedString (commandLine , `"'` , false )
197
198
if err != nil {
198
- return nil , nil , err
199
+ return nil , nil , "" , err
199
200
}
200
201
proc , err := paths .NewProcess (nil , parts ... )
201
202
if err != nil {
202
- return nil , nil , err
203
+ return nil , nil , "" , err
203
204
}
204
205
stdout , stderr , err := proc .RunAndCaptureOutput (ctx )
205
206
206
- // Append ctags arguments to stderr
207
207
args := fmt .Sprintln (strings .Join (parts , " " ))
208
- stderr = append ([]byte (args ), stderr ... )
209
- return stdout , stderr , err
208
+ return stdout , stderr , args , err
210
209
}
211
210
212
211
func filterSketchSource (sketch * sketch.Sketch , source io.Reader , removeLineMarkers bool ) string {
0 commit comments