Sha256: 5013112bcec04beabf254fe2b7935038a2a2a49a2c4e0b67457abf012f769cca

Contents?: true

Size: 1.02 KB

Versions: 5

Compression:

Stored size: 1.02 KB

Contents

module Coral
  module Vagrant
    module SubCommand
      class CoralAdd < ::Vagrant.plugin('2', :command)

        #-----------------------------------------------------------------------
        # Execution
        
        def execute
          options = {}
          success = true

          opts = OptionParser.new do |opts|
            opts.banner = 'Usage: coral add -h --repo={repository} {name} [ {type} ]'
            opts.separator ''

            options[:repo] = ''
            opts.on('-r', '--repo REPOSITORY', "Git repository URL of sub-project to add to project type") do |r|
              options[:repo] = r
            end
          end

          #---

          args = parse_options(opts)
          return unless args

          raise ::Vagrant::Errors::CLIInvalidUsage, :help => opts.help.chomp if args.length < 1

          project_name = args[0]
          project_type = ( args.size < 2 ? 'module' : args[1] )

          #---------
          # Start

          exit success ? 0 : 1
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
coral_vagrant-0.2.8 lib/coral_vagrant/commands/coral/add.rb
coral_vagrant-0.2.5 lib/coral_vagrant/commands/coral/add.rb
coral_vagrant-0.2.4 lib/coral_vagrant/commands/coral/add.rb
coral_vagrant-0.2.3 lib/coral_vagrant/commands/coral/add.rb
coral_vagrant-0.2.2 lib/coral_vagrant/commands/coral/add.rb