Class: Pitle::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/pitle.rb

Instance Method Summary collapse

Instance Method Details

#doObject



69
70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/pitle.rb', line 69

def do()
  extensions = options[:extension].split(",")

  Dir.open(Dir.pwd){ |d|
    fileNameOperator = FileNameOperator.new(d.children, extensions)
    origin_filenames = fileNameOperator.pick_files()

    if options[:print0]
      print "./#{origin_filenames.join("\0./")}"
    else
      origin_filenames.each { |f| puts f }
    end
  }
end