-l
This commit is contained in:
parent
03884289e3
commit
aeb4b08c6c
1 changed files with 3 additions and 3 deletions
6
ls.rb
6
ls.rb
|
@ -15,8 +15,8 @@ end
|
|||
|
||||
def list_filenames
|
||||
params = ARGV.getopts('a', 'r', 'l')
|
||||
flags = params['a'] ? File::FNM_DOTMATCH : 0
|
||||
filenames = Dir.glob('*', flags)
|
||||
filenames = params['a'] ? Dir.glob('*', File::FNM_DOTMATCH) : Dir.glob('*')
|
||||
filenames = filenames.reverse if params['r']
|
||||
params['l'] ? ownerinfo(filenames) : filenames
|
||||
if params['r']
|
||||
filenames.reverse
|
||||
|
@ -84,7 +84,7 @@ def file_type(file_stat)
|
|||
end
|
||||
|
||||
def file_size(filenames)
|
||||
filenames.map { |file| File.size(file) }.max.to_s.length + SIZE_INDENT
|
||||
filenames.map { |file| File.size(file) }.max.to_s.length
|
||||
end
|
||||
|
||||
def timestamp(file_stat)
|
||||
|
|
Loading…
Reference in a new issue