#!/usr/bin/env ruby # lib = File.join(File.dirname(__FILE__), '../lib') $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) begin require "rubygems" require 'colored' require "commander/import" require "pry" require "brief" end program :name, 'Brief' program :version, Brief::Version program :description, 'Brief CLI' command :inspect do |c| c.syntax = 'brief inspect file [options]' c.description = 'Debug the parsing of a brief' c.action do |args, options| path = Pathname(args.first) path = path.relative? ? Brief.root.join(path) : path doc = Brief::Document.new(path) doc.elements do |el| puts el.inspect end end end Pathname(lib).join("brief","cli","commands").children.each do |f| require(File.expand_path(f)) if f.file? end