The after_options_hook plugin supports an after_options configuration method, specifying a block to execute in context after parsing options, before executing the command or any subcommands. It is passed the remaining argv and already parsed options:
after_options do |argv, options| # ... end