lib/redis-copy/cli.rb in redis-copy-1.0.0.rc.0 vs lib/redis-copy/cli.rb in redis-copy-1.0.0.rc.1

- old
+ new

@@ -34,19 +34,40 @@ opts.separator " <source> and <destination> must be redis connection uris" opts.separator " like [redis://][<username>:<password>@]<hostname>[:<port>][/<db>]" opts.separator '' opts.separator "Specific options:" - opts.on('--pattern PATTERN', indent_desc[ + opts.on('-p', '--pattern PATTERN', indent_desc[ "Only transfer matching keys (default #{DEFAULTS[:pattern]})\n" + "See http://redis.io/commands/keys for more info." ]) do |pattern| options[:pattern] = pattern end + opts.on('-v', '--[no-]verify [PERCENT]', + "Verify percentage of transfers -- VERY SLOW (default #{DEFAULTS[:verify]})" + ) do |verify| + options[:verify] = case verify + when /\A1?[0-9]{2}\z/ + verify.to_i + when false, 'false', 'none' + 0 + else + 100 + end + end + + opts.on('-n', '--[no-]allow-nonempty', "Allow non-empty destination (default #{DEFAULTS[:allow_nonempty]})") do |allow_nonempty| + options[:allow_nonempty] = allow_nonempty + end + + opts.on('-f', '--[no-]fail-fast', "Abort on first failure (default #{DEFAULTS[:fail_fast]})") do |ff| + options[:fail_fast] = ff + end + opts.on('--[no-]pipeline', - "Use redis pipeline where available (default #{DEFAULTS[:pipeline]})" + "Pipeline redis commands where available (default #{DEFAULTS[:pipeline]})" ) do |pipeline| options[:pipeline] = pipeline end opts.on('-r', '--require FILENAME', indent_desc.( @@ -69,32 +90,11 @@ opts.on('-t', '--[no-]trace', "Enable backtrace on failure (default #{DEFAULTS[:trace]})") do |trace| options[:trace] = trace end - opts.on('-f', '--[no-]fail-fast', "Abort on first failure (default #{DEFAULTS[:fail_fast]})") do |ff| - options[:fail_fast] = ff - end - - opts.on('--[no-]verify [PERCENT]', - "Verify percentage of transfers -- VERY SLOW (default #{DEFAULTS[:verify]})" - ) do |verify| - options[:verify] = case verify - when /\A1?[0-9]{2}\z/ - verify.to_i - when false, 'false', 'none' - 0 - else - 100 - end - end - opts.on('--[no-]prompt', "Prompt for confirmation (default #{DEFAULTS[:prompt]})") do |prompt| options[:prompt] = prompt - end - - opts.on('--[no-]allow-nonempty', "Allow non-empty destination (default #{DEFAULTS[:allow_nonempty]})") do |allow_nonempty| - options[:allow_nonempty] = allow_nonempty end opts.on('--[no-]dry-run', 'Output configuration and exit') do |d| options[:dry_run] = true end