From 9f7606d1a8afd4a5b30d8b8edc89d9190aedf7cc Mon Sep 17 00:00:00 2001 From: Chris Wanstrath Date: Fri, 26 Mar 2010 15:31:01 -0700 Subject: [PATCH] Refactor mustache(1) to use OptionParser, give it a nicer -h --- bin/mustache | 122 ++++++++++++++++++++++++++++++++------------------- 1 file changed, 77 insertions(+), 45 deletions(-) diff --git a/bin/mustache b/bin/mustache index 7f566dc8..7407b93c 100755 --- a/bin/mustache +++ b/bin/mustache @@ -1,58 +1,90 @@ #!/usr/bin/env ruby -require 'mustache' require 'yaml' +require 'optparse' -def help - puts <<-usage -Usage: - $ cat data.yml template.mustache | mustache - $ mustache data.yml template.mustache - $ cat <