Module: Strata::CLI::AgentMode
- Included in:
- Main, SubCommands::Audit, SubCommands::Branch, SubCommands::Create, SubCommands::Datasource, SubCommands::Deploy, SubCommands::Project, SubCommands::Table
- Defined in:
- lib/strata/cli/agent_mode.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.included(base) ⇒ Object
8 9 10 11 |
# File 'lib/strata/cli/agent_mode.rb', line 8 def self.included(base) base.class_option :agent, type: :boolean, default: false, desc: "Agent mode: structured output, no interactive prompts" end |
Instance Method Details
#agent_mode? ⇒ Boolean
13 14 15 16 17 |
# File 'lib/strata/cli/agent_mode.rb', line 13 def agent_mode? value = [:agent] value = ["agent"] if value.nil? value == true end |
#reject_agent_mode!(message, code: "agent_mode_unsupported") ⇒ Object
19 20 21 22 23 |
# File 'lib/strata/cli/agent_mode.rb', line 19 def reject_agent_mode!(, code: "agent_mode_unsupported") return unless agent_mode? AgentOutput.emit_error(, code: code) end |