commands/docker-run: --help works [GH-3698]

This commit is contained in:
Mitchell Hashimoto 2014-05-07 15:11:57 -07:00
parent a00d2481f5
commit 61caaa00c6
2 changed files with 11 additions and 6 deletions

View File

@ -10,6 +10,7 @@ BUG FIXES:
Vagrantfile.
- core: Plugins that define config methods that collide with Ruby Kernel/Object
- methods are merged properly. [GH-3670]
- commands/docker-run: `--help` works. [GH-3698]
- commands/package: `--base` works without crashing for VirtualBox.
- commands/reload: If `--provision` is specified, force provisioning. [GH-3657]
- guests/redhat: Fix networking issues with CentOS. [GH-3649]

View File

@ -29,18 +29,22 @@ module VagrantPlugins
# Parse out the extra args to send to SSH, which is everything
# after the "--"
split_index = @argv.index("--")
if !split_index
@env.ui.error(I18n.t("docker_provider.run_command_required"))
return 1
end
if split_index
command = @argv.drop(split_index + 1)
@argv = @argv.take(split_index)
end
# Parse the options
argv = parse_options(opts)
return if !argv
# Show the error if we don't have "--" _after_ parse_options
# so that "-h" and "--help" work properly.
if !split_index
@env.ui.error(I18n.t("docker_provider.run_command_required"))
return 1
end
target_opts = { provider: :docker }
target_opts[:single_target] = options[:pty]