#!/usr/bin/env ruby # encoding: UTF-8 $LOAD_PATH.unshift File.expand_path(File.dirname(__FILE__)) + "/../lib" require "thor" require "tablelize" module Tablelize class Cli < Thor desc "version", "Show the current version" def version puts VERSION end desc "example", "Shows an example" def example rows = [["KEY", "VALUE", "NUMBER", "ALMOST_A_NUMBER"]] rows << ["name", "tablelize", 1, 2] rows << ["version", Tablelize::VERSION, 1.2, 3] rows << ["π", "10 digits of pie", 3.1415926535, 3] rows << ["some very long text", "Fake moose", 3.14, "3a"] Tablelize::table rows end end end Tablelize::Cli.start(ARGV)