Module: Benry::CmdApp

Extended by:
ClassMethodModule
Defined in:
lib/benry/cmdapp.rb

Defined Under Namespace

Modules: ClassMethodModule, Util Classes: ActionError, ActionHelpBuilder, ActionMetadata, ActionOptionSchema, ActionScope, AliasMetadata, Application, ApplicationContext, ApplicationHelpBuilder, BaseError, BaseHelpBuilder, BaseMetadata, BuiltInAction, CommandError, Config, DefinitionError, ExecutionError, GlobalOptionSchema, MetadataRenderer, OptionError, OptionParser, OptionSchema, OptionSet, Registry

Constant Summary collapse

ACTION_OPTION_SCHEMA_CLASS =
ActionOptionSchema
ACTION_OPTION_PARSER_CLASS =
OptionParser
ACTION_SHARED_OPTIONS =
proc {|dummy_schema|
  arr = []
  arr << dummy_schema.add(:help, "-h, --help", "print help message", hidden: true)#.freeze
  arr
}.call(OptionSchema.new)
Action =
ActionScope
REGISTRY =
Registry.new()
CONTEXT_CLASS =
ApplicationContext
APPLICATION_HELP_BUILDER_CLASS =
ApplicationHelpBuilder
ACTION_HELP_BUILDER_CLASS =
ActionHelpBuilder
GLOBAL_OPTION_SCHEMA_CLASS =
GlobalOptionSchema
GLOBAL_OPTION_PARSER_CLASS =
OptionParser

Class Method Summary collapse

Methods included from ClassMethodModule

_set_current_app, current_app, define_abbrev, define_alias, define_alias!, undef_action, undef_alias

Class Method Details

.main(app_desc, app_version = nil, **kwargs) ⇒ Object



2204
2205
2206
2207
2208
2209
2210
2211
2212
# File 'lib/benry/cmdapp.rb', line 2204

def self.main(app_desc, app_version=nil, **kwargs)
  #; [!6mfxt] accepts the same arguments as 'Config#initialize()'.
  config = Config.new(app_desc, app_version, **kwargs)
  #; [!scpwa] runs application.
  app = Application.new(config)
  #; [!jbv9z] returns the status code.
  status_code = app.main()
  return status_code
end