#!/usr/bin/env ruby require 'twee2' class Twee2CLI < Thor package_name 'Twee2' map '-h' => :help map '--help' => :help desc 'build [INPUT] [OUTPUT]', 'compiles a Twee-like file into Twee2-like output' method_option :format, type: :string, default: Twee2::DEFAULT_FORMAT def build(input, output) Twee2::build(input, output, options) end desc 'watch', 'like "build", but watches for changes and automatically rebuilds on the fly' method_option :format, type: :string, default: Twee2::DEFAULT_FORMAT def watch(input, output) Twee2::watch(input, output, options) end desc 'formats', 'lists understood output formats' def formats Twee2::formats end desc 'help', 'shows usage instructions' def help Twee2::help end default_task :help end Twee2CLI.start