lib/clin/command_dispatcher.rb
# Parse the command line using the given arguments
# It will return the newly initialized command with the arguments if there is a match
# Otherwise will fail and display the help message
# @param argv [Array<String>] Arguments
# @return [Clin::Command]
Parse the command line using the given arguments
It will return the newly initialized command with the arguments if there is a match
Otherwise will fail and display the help message
Parse the command line using the given arguments It will return the newly initialized command with the arguments if there is a match Otherwise will fail and display the help message
def parse(argv = ARGV)
    errors = 0
    argv = Shellwords.split(argv) if argv.is_a? String
    @commands.each do |cmd|
      begin
        return cmd.parse(argv, fallback_help: false)
      rescue Clin::ArgumentError
        errors += 1
      end
    end
    fail Clin::HelpError, help_message
  end
def parse ( argv = ARGV ) errors = 0 argv = Shellwords . split ( argv ) if argv . is_a? String @commands . each do | cmd | begin return cmd . parse ( argv , fallback_help : false ) rescue Clin :: ArgumentError errors += 1 end end fail Clin :: HelpError , help_message end
Parse the command line using the given arguments
It will return the newly initialized command with the arguments if there is a match
Otherwise will fail and display the help message
Parse the command line using the given arguments It will return the newly initialized command with the arguments if there is a match Otherwise will fail and display the help message
None
Clin::Command
argv
None