Sha256: c231324e95886cbdbfd5d51392af752adc1ed2bfa9cb38dabbc8bba7439128cc
Contents?: true
Size: 872 Bytes
Versions: 15
Compression:
Stored size: 872 Bytes
Contents
module Oscar::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
15 entries across 15 versions & 1 rubygems