bin/nanoc in nanoc-1.1.3 vs bin/nanoc in nanoc-1.2
- old
+ new
@@ -1,31 +1,34 @@
#!/usr/bin/env ruby
-# Available options:
-#
-# -h, --help:
-# prints the help
-#
-# -t <template>, --template <template>
-# Uses the specified template when creating a page
-#
-# -v, --version:
-# prints the version information
+require File.dirname(__FILE__) + '/../lib/nanoc.rb'
-require 'rubygems' rescue nil
require 'getoptlong'
-require File.dirname(__FILE__) + '/../lib/nanoc.rb'
+try_require 'rubygems'
# Define some texts
version_text = "nanoc #{Nanoc::VERSION} (c) 2007 Denis Defreyne."
+usage_text = "Usage: nanoc [options] [command] [parameters]"
help_text = <<EOT
-usage: nanoc [-hv]
+Usage: nanoc [-chv]
nanoc create_site <name>
nanoc create_page <name> [-t template]
nanoc create_template <name>
nanoc compile
+
+Options:
+ -h, --help Show this help message and quit.
+ -v, --version Show the nanoc version number and quit.
+ -t, --template Template that should be used when creating a page.
+ (can only be used with create_page)
+
+Description:
+ The 'nanoc' command is used for creating nanoc-powered sites, as well as
+ managing them: creating pages and templates and compiling the site.
+
+ Read more about nanoc on the site: <http://stoneship.org/software/nanoc/>
EOT
# Parse options
opts = GetoptLong.new(
[ '--help', '-h', GetoptLong::NO_ARGUMENT ],
@@ -45,16 +48,16 @@
else
unprocessed_opts[opt] = arg
end
end
rescue GetoptLong::InvalidOption
- $stderr.puts help_text
+ $stderr.puts usage_text
exit
end
# Make sure we have at least one argument
if ARGV.size == 0
- $stderr.puts help_text
+ $stderr.puts usage_text
exit
end
# Handle command
command = ARGV[0]