def parse_args
      parser = Trollop::Parser.new do
        opt :name, "", :default => CloudFactory::UNKNOWN_CLOUD_NAME.to_s
        opt :requires_network_config
        opt :action, "",  :type => :string
        opt :only_if
        opt :parameters, "",:type => :string
        opt :quiet # note that :quiet is deprecated (use -v instead) because Trollop cannot easily support inverse flags that default to true
        opt :verbose
      end
      parse do
        options = parser.parse
        if options[:parameters_given]
          if options[:parameters].start_with?("[")
            options[:parameters] = JSON.parse(options[:parameters])
          else
            options[:parameters] = [options[:parameters]]
          end
        end
        options
      end
    end
def parse_args
      parser = Trollop::Parser.new do
        opt :name, "", :default => CloudFactory::UNKNOWN_CLOUD_NAME.to_s
        opt :requires_network_config
        opt :action, "",  :type => :string
        opt :only_if
        opt :parameters, "",:type => :string
        opt :quiet # note that :quiet is deprecated (use -v instead) because Trollop cannot easily support inverse flags that default to true
        opt :verbose
      end
      parse do
        options = parser.parse
        if options[:parameters_given]
          if options[:parameters].start_with?("[")
            options[:parameters] = JSON.parse(options[:parameters])
          else
            options[:parameters] = [options[:parameters]]
          end
        end
        options
      end
    end
Parse arguments