Sha256: 73e3e92ed5bede71ee390f0cc08d74755ab0c8f4613ac419cddc4bd17cc53b9c

Contents?: true

Size: 1012 Bytes

Versions: 7

Compression:

Stored size: 1012 Bytes

Contents

require 'optparse'
require_relative 'base'

module VagrantPlugins
  module Invade
    module Command
      class Validate < Base
        def execute
          options = {}
          opts = OptionParser.new do |o|
            o.banner = 'Usage: vagrant invade validate [-f|--force] [-q|--quiet] [-h]'
            o.separator ''
            o.on('-f', '--force', 'Force replacing current Vagrantfile') do |f|
              options[:force] = f
            end
            o.on('-q', '--quiet', 'Just make it whisper.') do |q|
              options[:quiet] = q
            end
          end

          # Parse the options
          argv = parse_options(opts)
          return unless argv

          # Validates InVaDE configuration
          action(Action.process, {
            :invade_validate_force => options[:force],
            :invade_validate_quiet => options[:quiet],
            :invade_generate => false
          })

          # Success, exit status 0
          0
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
vagrant-invade-0.8.0 lib/vagrant-invade/command/validate.rb
vagrant-invade-0.7.0 lib/vagrant-invade/command/validate.rb
vagrant-invade-0.6.4 lib/vagrant-invade/command/validate.rb
vagrant-invade-0.6.3 lib/vagrant-invade/command/validate.rb
vagrant-invade-0.6.2 lib/vagrant-invade/command/validate.rb
vagrant-invade-0.6.1 lib/vagrant-invade/command/validate.rb
vagrant-invade-0.6.0 lib/vagrant-invade/command/validate.rb