@@ -295,19 +295,6 @@ func handleSpecialCliOptions(args []string) {
295
295
}
296
296
}
297
297
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
-
311
298
func actionProcessStdinReplace (changesets []changeset ) (int ) {
312
299
scanner := bufio .NewScanner (os .Stdin )
313
300
for scanner .Scan () {
@@ -355,7 +342,6 @@ func actionProcessFiles(changesets []changeset, fileitems []fileitem) (int) {
355
342
356
343
// process file list
357
344
for _ , file := range fileitems {
358
- fmt .Println (file .Path )
359
345
swg .Add ()
360
346
go func (file fileitem , changesets []changeset ) {
361
347
var (
@@ -440,6 +426,7 @@ func buildFileitems(args []string) ([]fileitem) {
440
426
file fileitem
441
427
)
442
428
429
+ // Build filelist from arguments
443
430
for _ , filepath := range args {
444
431
file = fileitem {filepath , filepath }
445
432
@@ -462,21 +449,18 @@ func buildFileitems(args []string) ([]fileitem) {
462
449
463
450
// --path parsing
464
451
if opts .Path != "" {
465
- for _ , filepath := range getFilelistByPath ( ) {
452
+ searchFilesInPath ( opts . Path , func ( f os. FileInfo , filepath string ) {
466
453
file := fileitem {filepath , filepath }
467
454
468
- if opts .Output != "" {
469
- // use specific output
470
- file .Output = opts .Output
471
- } else if opts .OutputStripFileExt != "" {
455
+ if opts .OutputStripFileExt != "" {
472
456
// remove file ext from saving destination
473
457
file .Output = strings .TrimSuffix (file .Output , opts .OutputStripFileExt )
474
458
}
475
459
476
460
// no colon parsing here
477
461
478
462
fileitems = append (fileitems , file )
479
- }
463
+ })
480
464
}
481
465
482
466
return fileitems
0 commit comments