module CommandKit::Main

Defines a `main` method.

## Examples

include CommandKit::Main

def main(argv=[])
  # ...
  return 0
end

Public Instance Methods

main(argv=[]) click to toggle source

Place-holder `main` method, which parses options, before calling {#run}.

@param [Array<String>] argv

The Array of command-line arguments.

@return [Integer]

The exit status code.

@note `argv` is splatted into {#run}.

@api public

# File lib/command_kit/main.rb, line 94
def main(argv=[])
  run(*argv)
  return 0
rescue SystemExit => system_exit
  return system_exit.status
end
run(*args) click to toggle source

Place-holder method for command business logic.

@param [Array<Object>] args

Additional arguments for the command.

@abstract

@api public

# File lib/command_kit/main.rb, line 111
def run(*args)
end