Module: PgEventstore::CLI
- Defined in:
- lib/pg_eventstore/cli.rb,
lib/pg_eventstore/cli/exit_codes.rb,
lib/pg_eventstore/cli/parsers/base_parser.rb,
lib/pg_eventstore/cli/commands/base_command.rb,
lib/pg_eventstore/cli/commands/help_command.rb,
lib/pg_eventstore/cli/parsers/default_parser.rb,
lib/pg_eventstore/cli/parser_options/metadata.rb,
lib/pg_eventstore/cli/parser_options/base_options.rb,
lib/pg_eventstore/cli/parsers/subscription_parser.rb,
lib/pg_eventstore/cli/try_unlock_subscriptions_set.rb,
lib/pg_eventstore/cli/parser_options/default_options.rb,
lib/pg_eventstore/cli/try_to_delete_subscriptions_set.rb,
lib/pg_eventstore/cli/commands/stop_subscriptions_command.rb,
lib/pg_eventstore/cli/parser_options/subscription_options.rb,
lib/pg_eventstore/cli/wait_for_subscriptions_set_shutdown.rb,
lib/pg_eventstore/cli/commands/start_subscriptions_command.rb,
lib/pg_eventstore/cli/commands/callback_handlers/start_cmd_handlers.rb
Defined Under Namespace
Modules: Commands, ExitCodes, ParserOptions, Parsers Classes: TryToDeleteSubscriptionsSet, TryUnlockSubscriptionsSet, WaitForSubscriptionsSetShutdown
Constant Summary collapse
- OPTIONS_PARSER =
{ "subscriptions" => [Parsers::SubscriptionParser, ParserOptions::SubscriptionOptions].freeze }.tap do |directions| directions.default = [Parsers::DefaultParser, ParserOptions::DefaultOptions].freeze end.freeze
- COMMANDS =
{ ["subscriptions", "start"].freeze => Commands::StartSubscriptionsCommand, ["subscriptions", "stop"].freeze => Commands::StopSubscriptionsCommand }.freeze
Class Method Summary collapse
Class Method Details
.callbacks ⇒ PgEventstore::Callbacks
25 26 27 |
# File 'lib/pg_eventstore/cli.rb', line 25 def callbacks @callbacks ||= Callbacks.new end |
.execute(args) ⇒ Integer
Returns exit code.
31 32 33 34 35 36 37 38 39 |
# File 'lib/pg_eventstore/cli.rb', line 31 def execute(args) , = OPTIONS_PARSER[args[0]] command, = .new(ARGV, .new).parse return Commands::HelpCommand.new().call if .help return COMMANDS[command].new().call if COMMANDS[command] _, = .new(['-h'], .new).parse Commands::HelpCommand.new().call end |