Sha256: da16ad2c64ae81dc6785a629c3524b32d0ad5204eb9e9510630ed53934cd0c5b
Contents?: true
Size: 1.56 KB
Versions: 2
Compression:
Stored size: 1.56 KB
Contents
require "thor" require "agile_utils" module FoldersRenamer class CLI < Thor desc "rename", "Cleanup and rename folders" method_option "base_dir", aliases: "-b", desc: "Starting directory", default: Dir.pwd, required: true method_option "sep_string", aliases: "-s", desc: "Separtor string to use", default: ".", required: true method_option :commit, type: :boolean, aliases: "-c", desc: "Commit your changes", default: false method_option "version", aliases: "-v", desc: "Display version number" def rename opts = options.symbolize_keys if opts[:version] puts "You are using FoldersRenamer version #{FoldersRenamer::VERSION}" exit end puts "Your options #{opts}" FoldersRenamer.rename(opts) end desc "usage", "Display help screen" def usage puts <<-EOS Usage: folders_renamer -b, --base-dir=BASE_DIR -s, --sep-string=SEP_STRING Options: -b, --base-dir=BASE_DIR # Starting directory # Default: . (current directory) -s, --sep-string=SEP_STRING # Separtor string to use # Default: . -c, [--commit], [--no-commit] # Commit your changes -v, [--version=VERSION] # Display version number Cleanup and rename folders EOS end default_task :usage end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
folders_renamer-0.2.2 | lib/folders_renamer/cli.rb |
folders_renamer-0.1.4 | lib/folders_renamer/cli.rb |