Sha256: 44048fbd444e0833c592be86095190eb407c25698b170bc55d3f1004cb7f90df

Contents?: true

Size: 1 KB

Versions: 34

Compression:

Stored size: 1 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 = Kernel.const_get(workflow).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 "## COMMANDS"
puts
puts "Command:"
puts 
puts "  #{File.basename($0)} #{prev * " "}"
puts 
puts "Subcommands:"
puts 
commands(prev).each do |command|
    puts "  " << command
end
    

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
rbbt-util-5.5.53 share/rbbt_commands/workflow/cmd
rbbt-util-5.5.52 share/rbbt_commands/workflow/cmd
rbbt-util-5.5.51 share/rbbt_commands/workflow/cmd
rbbt-util-5.5.50 share/rbbt_commands/workflow/cmd
rbbt-util-5.5.49 share/rbbt_commands/workflow/cmd
rbbt-util-5.5.48 share/rbbt_commands/workflow/cmd
rbbt-util-5.5.47 share/rbbt_commands/workflow/cmd
rbbt-util-5.5.46 share/rbbt_commands/workflow/cmd
rbbt-util-5.5.45 share/rbbt_commands/workflow/cmd
rbbt-util-5.5.44 share/rbbt_commands/workflow/cmd
rbbt-util-5.5.43 share/rbbt_commands/workflow/cmd
rbbt-util-5.5.42 share/rbbt_commands/workflow/cmd
rbbt-util-5.5.41 share/rbbt_commands/workflow/cmd
rbbt-util-5.5.40 share/rbbt_commands/workflow/cmd
rbbt-util-5.5.39 share/rbbt_commands/workflow/cmd
rbbt-util-5.5.38 share/rbbt_commands/workflow/cmd
rbbt-util-5.5.37 share/rbbt_commands/workflow/cmd
rbbt-util-5.5.36 share/rbbt_commands/workflow/cmd
rbbt-util-5.5.35 share/rbbt_commands/workflow/cmd
rbbt-util-5.5.34 share/rbbt_commands/workflow/cmd