#!/usr/bin/env ruby require 'codetree' require 'optparse' OptionParser.new do |opts| opts.banner = "Usage: codetree [options]" opts.on("-f", "--[no-]flat", "display flat list/tree") do |v| $flat = v || false end opts.on("-d", "--detail", "Specify a detail value [:none,:light,:medium,:full]") do |v| $detail = v || :medium end end.parse! p $detail p $flat codetree = Codetree::ParseTree.new(Dir['lib/*/*/*/*.rb'] + Dir['lib/*/*/*.rb'] + Dir['lib/*/*.rb'] + Dir['lib/*.rb']) codetree.print_tree detail: $detail, flat: $flat