lib/chef/fork/commands/data.rb in chef-fork-0.1.0 vs lib/chef/fork/commands/data.rb in chef-fork-0.1.1
- old
+ new
@@ -6,33 +6,34 @@
class Chef
class Fork
module Commands
class Data < Noop
def run(args=[])
- case args.first
+ rest = optparse.order(args)
+ case rest.first
when "bag"
- data_bag(args.slice(1..-1))
+ data_bag(rest.slice(1..-1) || [])
else
- raise(NameError.new(args.inspect))
+ raise(NameError.new(rest.inspect))
end
end
private
def data_bag(args=[])
case args.first
when "from"
- data_bag_from(args.slice(1..-1))
+ data_bag_from(args.slice(1..-1) || [])
when "show"
- data_bag_show(args.slice(1..-1))
+ data_bag_show(args.slice(1..-1) || [])
else
raise(NameError.new(args.inspect))
end
end
def data_bag_from(args=[])
case args.first
when "file"
- data_bag_from_file(args.slice(1..-1))
+ data_bag_from_file(args.slice(1..-1) || [])
else
raise(NameError.new(args.inspect))
end
end