-a
This commit is contained in:
parent
a6fb0f99ba
commit
04618d986f
1 changed files with 21 additions and 0 deletions
21
ls.rb
21
ls.rb
|
@ -1,5 +1,26 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'optparse'
|
||||
|
||||
def options
|
||||
secret_files = {}
|
||||
opt = OptionParser.new
|
||||
opt.on('-a') { |v| params[:a] = v }
|
||||
opt.on('-r') { |v| params[:r] = v }
|
||||
secret_files[:dir] = opt.parse!(ARGV)[0]
|
||||
secret_files
|
||||
end
|
||||
|
||||
SELECTED = options
|
||||
|
||||
def get_files(option_a: false)
|
||||
if option_a
|
||||
Dir.glob('*', File::FNM_DOTMATCH, base: SELECTED_OPTION[:dir])
|
||||
else
|
||||
Dir.glob('*', base: SELECTED[:dir])
|
||||
end
|
||||
end
|
||||
|
||||
COLUMNS = 3
|
||||
|
||||
def run
|
||||
|
|
Loading…
Reference in a new issue