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