title: How to implement custom option for Vagrant without having invalid option warning?
body: <p>I'm trying to implement new custom option for Vagrant as in the following <code>Vagrantfile</code>:</p>
  
  <pre><code># -*- mode: ruby -*-
  require 'getoptlong'
  
  opts = GetoptLong.new(
    [ '--vm-name',        GetoptLong::OPTIONAL_ARGUMENT ],
  )
  
  vm_name        = ENV['VM_NAME'] || 'default'
  
  begin
    opts.each do |opt, arg|
      case opt
        when '--vm-name';        vm_name        = arg
      end
    end
    rescue
  # @fixme: An invalid option error happens here.
  end
  
  Vagrant.configure(2) do |config|
    config.vm.define vm_name
    config.vm.provider "virtualbox" do |vbox, override|
      override.vm.box = "ubuntu/wily64"
    end
  end
  </code></pre>
  
  <p>Now, each time when I run any vagrant command it's showing the following warning, e.g.</p>
  
  <pre><code>vagrant destroy -f
  </code></pre>
  
  <blockquote>
    <p>/opt/vagrant/embedded/gems/gems/vagrant-1.8.1/bin/vagrant: invalid option -- f</p>
  </blockquote>
  
  <p>Another example:</p>
  
  <pre><code>$ vagrant --vm-name=foo up --no-provision
  /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/bin/vagrant: unrecognized option `--no-provision'
  Bringing machine 'foo' up with 'virtualbox' provider...
  ==&gt; foo: Importing base box 'ubuntu/wily64'...
  </code></pre>
  
  <p>Is there any way that I can ignore such warning from happening in the above <code>rescue</code> section?</p>
  
  <hr>
  
  <p>This <a href="https://stackoverflow.com/q/3642331/55075">post</a> is similar, but it doesn't help much in this case.</p>