#!/usr/bin/env ruby $LOAD_PATH.unshift File.dirname(__FILE__) + '/../lib' require 'rubygems' require 'gli' require 'docurium' require 'docurium/cli' include GLI::App version Docurium::Version desc 'Generate HTML documentation' long_desc 'Generate HTML docs from a Docurium config file' command :doc do |c| c.flag :for, :desc => "The version to generate", :multiple => true c.action do |global_options,options,args| file = args.first Docurium::CLI.doc(file, options) end end desc 'Generate Docurium config file template' long_desc 'Generate Docurium config file template' command :gen do |c| c.action do |global_options,options,args| file = args.first || 'api.docurium' Docurium::CLI.gen(file) end end pre { |global,command,options,args| true } post { |global,command,options,args| true } on_error do |exception| if !exception.is_a?(SystemExit) puts exception puts exception.backtrace end end exit run(ARGV)