lib/aia/main.rb in aia-0.5.11 vs lib/aia/main.rb in aia-0.5.12
- old
+ new
@@ -41,15 +41,15 @@
@logger = AIA::Logging.new(AIA.config.log_file)
@logger.info(AIA.config) if AIA.config.debug? || AIA.config.verbose?
- @prompt = AIA::Prompt.new.prompt
-
@directives_processor = AIA::Directives.new
+ @prompt = AIA::Prompt.new.prompt
+
# TODO: still should verify that the tools are ion the $PATH
# tools.class.verify_tools
end
@@ -69,10 +69,12 @@
Reline::HISTORY.clear
# Reline::HISTORY.max_size = max_history_size
end
+ # This will be recursive with the new options
+ # --next and --pipeline
def call
directive_output = @directives_processor.execute_my_directives
if AIA.config.chat?
AIA.config.out_file = STDOUT
@@ -122,9 +124,20 @@
if AIA.config.chat?
setup_reline_history
speak result
lets_chat
end
+
+ return if AIA.config.next.empty? && AIA.config.pipeline.empty?
+
+ # Reset some config items to defaults
+ AIA.config.directives = []
+ AIA.config.next = AIA.config.pipeline.shift
+ AIA.config.arguments = [AIA.config.next, AIA.config.out_file.to_s]
+ AIA.config.next = ""
+
+ @prompt = AIA::Prompt.new.prompt
+ call # Recurse!
end
def get_and_display_result(the_prompt_text)
spinner.auto_spin if AIA.config.verbose?