Sha256: 38ddd6dbdc82ea6440348b9856e65ec665ba10268906149e9ebd525219223b3e
Contents?: true
Size: 879 Bytes
Versions: 24
Compression:
Stored size: 879 Bytes
Contents
module VagrantHosts::Command::Helpers private def split_argv @main_args, @subcommand, @sub_args = split_main_and_subcommand(@argv) end def invoke_subcommand if @subcommand and (klass = @subcommands.get(@subcommand)) klass.new(@argv, @env).execute elsif @subcommand @env.ui.error "Unrecognized subcommand: #{@subcommand}" print_subcommand_help(:error) else print_subcommand_help end end def print_subcommand_help(output = :info) msg = [] msg << "Usage: vagrant #{@cmd_name} <command> [<args>]" msg << '' msg << 'Available subcommands:' keys = [] @subcommands.each { |(key, _)| keys << key } msg += keys.sort.map { |key| " #{key}" } msg << '' msg << "For help on any individual command run `vagrant #{@cmd_name} <command> -h`" @env.ui.send(output, msg.join("\n")) end end
Version data entries
24 entries across 24 versions & 1 rubygems