@@ -295,19 +295,6 @@ func handleSpecialCliOptions(args []string) {
295295 }
296296}
297297
298- func getFilelistByPath () []string {
299- var ret []string
300- 301- // --path
302- if (opts .Path != "" ) {
303- searchFilesInPath (opts .Path , func (f os.FileInfo , path string ) {
304- ret = append (ret , path )
305- })
306- }
307- 308- return ret
309- }
310- 311298func actionProcessStdinReplace (changesets []changeset ) (int ) {
312299 scanner := bufio .NewScanner (os .Stdin )
313300 for scanner .Scan () {
@@ -355,7 +342,6 @@ func actionProcessFiles(changesets []changeset, fileitems []fileitem) (int) {
355342
356343 // process file list
357344 for _ , file := range fileitems {
358- fmt .Println (file .Path )
359345 swg .Add ()
360346 go func (file fileitem , changesets []changeset ) {
361347 var (
@@ -440,6 +426,7 @@ func buildFileitems(args []string) ([]fileitem) {
440426 file fileitem
441427 )
442428
429+ // Build filelist from arguments
443430 for _ , filepath := range args {
444431 file = fileitem {filepath , filepath }
445432
@@ -462,21 +449,18 @@ func buildFileitems(args []string) ([]fileitem) {
462449
463450 // --path parsing
464451 if opts .Path != "" {
465- for _ , filepath := range getFilelistByPath ( ) {
452+ searchFilesInPath ( opts . Path , func ( f os. FileInfo , filepath string ) {
466453 file := fileitem {filepath , filepath }
467454
468- if opts .Output != "" {
469- // use specific output
470- file .Output = opts .Output
471- } else if opts .OutputStripFileExt != "" {
455+ if opts .OutputStripFileExt != "" {
472456 // remove file ext from saving destination
473457 file .Output = strings .TrimSuffix (file .Output , opts .OutputStripFileExt )
474458 }
475459
476460 // no colon parsing here
477461
478462 fileitems = append (fileitems , file )
479- }
463+ })
480464 }
481465
482466 return fileitems
0 commit comments