lib/rdiff_simple/options_parser.rb in rdiff-simple-0.1.0 vs lib/rdiff_simple/options_parser.rb in rdiff-simple-0.1.1
- old
+ new
@@ -1,17 +1,12 @@
module RdiffSimple
class OptionsParser
def self.parse(*args)
options = args.extract_options!
- args.reverse!
-
- source = args.pop
- destination = args.pop
-
- flags = args.reverse.map { |flag| flag.size == 1 ? "-#{flag}" : "--#{flag}" } * ' '
+ flags = args.map { |flag| flag.size == 1 ? "-#{flag}" : "--#{flag}" } * ' '
arguments = options.map { |key, value| (key.size == 1 ? "-#{key}" : "--#{key}") + " #{value}" } * ' '
- "#{flags} #{arguments} #{source} #{destination}".dasherize.strip
+ "#{flags} #{arguments}".dasherize.strip
end
end
end