Sha256: 90aeebd7118170eacd252553816d86c4f8a7de02abeba732893239a2fb618c9f

Contents?: true

Size: 600 Bytes

Versions: 8

Compression:

Stored size: 600 Bytes

Contents

#!/usr/bin/env ruby

require 'optparse'
require 'organize_files'

options = {}
OptionParser.new do |opts|
  opts.banner = 'Usage: organize_files [options]'

  opts.on('-d', '--directory DIRECTORY', 'Directory to organize') do |directory|
    options[:directory] = directory
  end

  opts.on('-h', '--help', 'Prints this help') do
    puts opts
    exit
  end
end.parse!

if options[:directory].nil?
  puts 'You must specify a directory to organize'
  exit 1
end

sorter = OrganizeFiles::Organizer.new(options[:directory])
sorter.organize

puts "Files in '#{options[:directory]}' have been organized"

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
organize_files-1.0.8 bin/organize_files
organize_files-1.0.7 bin/organize_files
organize_files-1.0.6 bin/organize_files
organize_files-1.0.5 bin/organize_files
organize_files-1.0.4 bin/organize_files
organize_files-1.0.3 bin/organize_files
organize_files-1.0.2 bin/organize_files
organize_files-1.0.1 bin/organize_files