lib/vagrant/scp/commands/scp.rb in vagrant-scp-0.4.0 vs lib/vagrant/scp/commands/scp.rb in vagrant-scp-0.4.1

- old
+ new

@@ -9,10 +9,11 @@ end def execute # Parse the arguments file_1, file_2 = parse_args() + return if file_2.nil? # Extract host info # # We want to get the name of the vm, from a [host_1]:file_1 [host_2]:file_2 description host = [file_1, file_2].map{|file_spec| file_spec.match(/^([^:]*):/)[1] rescue nil}.compact.first @@ -49,11 +50,12 @@ o.separator "" o.separator "Options:" o.separator "" end argv = parse_options(opts) - @env.ui.info(opts.help, prefix: false) unless argv.length == 2 - return argv + return argv if argv and argv.length == 2 + @env.ui.info(opts.help, prefix: false) if argv + return nil, nil end end end