Sha256: 067a74548965238cfbc5e761c2381bd58037a29573efa03bd04d5e6fadac2647

Contents?: true

Size: 1.08 KB

Versions: 44

Compression:

Stored size: 1.08 KB

Contents

#!/usr/bin/env ruby

require 'rbbt'
require 'rbbt/util/simpleopt'
require 'rbbt/workflow'

workflow = ARGV.shift

Workflow.require_workflow workflow
dir = $command_dir = Workflow.workflows.last.libdir.share.rbbt_commands
def commands(prev)
    rbbt_command_dir = $command_dir

    command_file_dirs = rbbt_command_dir.find_all
    command_files = command_file_dirs.collect{|d| d.glob('*') }.flatten
    command_files.collect{|p| File.basename(p) }.uniq.reject{|p| p =~ /\.desc$/}.sort
end


prev = []

begin
  while ARGV.any?
    command = ARGV.shift
    case
    when File.directory?(dir[command].find)
      prev << command
      dir = dir[command]
    when dir[command].exists?
      load dir[command].find
      exit 0
    else
      puts "Error: Command not understood"
      puts
      break
    end
  end
end

puts SOPT.doc
puts
puts Log.color :magenta, "## COMMANDS"
puts
puts Log.color :magenta, "Command:"
puts 
puts "  #{File.basename($0)} #{$previous_commands * " "} cmd"
puts 
puts Log.color :magenta, "Subcommands:"
puts 
commands(prev).each do |command|
    puts "  " << command
end
    

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
rbbt-util-5.13.19 share/rbbt_commands/workflow/cmd
rbbt-util-5.13.18 share/rbbt_commands/workflow/cmd
rbbt-util-5.13.17 share/rbbt_commands/workflow/cmd
rbbt-util-5.13.16 share/rbbt_commands/workflow/cmd
rbbt-util-5.13.15 share/rbbt_commands/workflow/cmd
rbbt-util-5.13.14 share/rbbt_commands/workflow/cmd
rbbt-util-5.13.13 share/rbbt_commands/workflow/cmd
rbbt-util-5.13.12 share/rbbt_commands/workflow/cmd
rbbt-util-5.13.11 share/rbbt_commands/workflow/cmd
rbbt-util-5.13.10 share/rbbt_commands/workflow/cmd
rbbt-util-5.13.9 share/rbbt_commands/workflow/cmd
rbbt-util-5.13.8 share/rbbt_commands/workflow/cmd
rbbt-util-5.13.7 share/rbbt_commands/workflow/cmd
rbbt-util-5.13.6 share/rbbt_commands/workflow/cmd
rbbt-util-5.13.5 share/rbbt_commands/workflow/cmd
rbbt-util-5.13.4 share/rbbt_commands/workflow/cmd
rbbt-util-5.13.3 share/rbbt_commands/workflow/cmd
rbbt-util-5.13.2 share/rbbt_commands/workflow/cmd
rbbt-util-5.13.1 share/rbbt_commands/workflow/cmd
rbbt-util-5.13.0 share/rbbt_commands/workflow/cmd