lib/simple_scripting/tab_completion.rb
def complete(execution_target, source_commandline=ENV.fetch('COMP_LINE'), cursor_position=ENV.fetch('COMP_POINT').to_i)
      commandline_processor = CommandlineProcessor.process_commandline(source_commandline, cursor_position, @switches_definition)

      if commandline_processor.completing_an_option?
        complete_option(commandline_processor, execution_target)
      elsif commandline_processor.parsing_error?
        return
      else # completing_a_value?
        complete_value(commandline_processor, execution_target)
      end
    end
def complete(execution_target, source_commandline=ENV.fetch('COMP_LINE'), cursor_position=ENV.fetch('COMP_POINT').to_i)
      commandline_processor = CommandlineProcessor.process_commandline(source_commandline, cursor_position, @switches_definition)

      if commandline_processor.completing_an_option?
        complete_option(commandline_processor, execution_target)
      elsif commandline_processor.parsing_error?
        return
      else # completing_a_value?
        complete_value(commandline_processor, execution_target)
      end
    end
def complete ( execution_target , source_commandline = ENV . fetch ( 'COMP_LINE' ) , cursor_position = ENV . fetch ( 'COMP_POINT' ) . to_i ) commandline_processor = CommandlineProcessor . process_commandline ( source_commandline , cursor_position , @switches_definition ) if commandline_processor . completing_an_option? complete_option ( commandline_processor , execution_target ) elsif commandline_processor . parsing_error? return else # completing_a_value? complete_value ( commandline_processor , execution_target ) end end
Currently, any completion suffix is ignored and stripped.
Currently any completion suffix is ignored and stripped .