Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Better help messages

  • Loading branch information...
commit 6bf3d70a18ef9c7831ec4f94b795677ab064024e 1 parent 55c82de
@dmfrancisco authored
Showing with 26 additions and 20 deletions.
  1. +26 −20 watch
View
46 watch
@@ -152,40 +152,46 @@ module Options
def self.init
$optparse = OptionParser.new do |opts|
- # Help
- opts.on( '-h', '--help', 'Show this help message' ) do
- puts opts
- exit
- end
# Slideshow folder
- opts.on( '-s', '--source DIR', 'Creates a slideshow using the files on the specified folder' ) do |dir|
- $settings[:source] = dir
- $settings[:custom_source] = true # This var is only used to print a better error message
+ opts.on( '-s', '--source DIR', "Creates a slideshow using the files on the specified folder " \
+ "(default is '#{$settings[:source]}')" ) do |dir|
+ $settings[:source] = dir
+ $settings[:custom_source] = true # This var is only used to print a better error message
end
# Name of the resulting html file
- opts.on( '-o', '--output FILENAME', 'Name of the resulting html file' ) do |filename|
- $settings[:output] = filename
+ opts.on( '-o', '--output FILENAME', "Name of the resulting html file " \
+ "(default is '#{$settings[:output]}')" ) do |filename|
+ $settings[:output] = filename
end
# Name of the master slide html file
- opts.on( '-i', '--input FILENAME', 'Name of the master slide file' ) do |filename|
- $settings[:master] = filename
- $settings[:custom_master] = true # This var is only used to print a better error message
+ opts.on( '-i', '--input FILENAME', "Name of the master slide file " \
+ "(default is '#{$settings[:master]}')" ) do |filename|
+ $settings[:master] = filename
+ $settings[:custom_master] = true # This var is only used to print a better error message
end
# Allow several slideshows inside the source folder
- opts.on( '-m', '--multiple', 'Allow several slideshows inside the source folder' ) do
+ opts.on( '-m', '--multiple', 'Allows several slideshows inside the source folder' ) do
$settings[:multiple] = true
end
# Excluding live.js
- opts.on( '-n', '--nolive', 'Excludes the live.js library' ) do
- $settings[:live] = false
+ opts.on( '-n', '--nolivejs', "Excludes the live.js library " \
+ "(live.js should only be used while developing)" ) do
+ $settings[:live] = false
end
# Port number
- opts.on( '-p', '--port PORT', 'Runs on the specified port' ) do |port|
- $settings[:port] = port
+ opts.on( '-p', '--port PORT', "Runs on the specified port " \
+ "(default is #{$settings[:port]})" ) do |port|
+ $settings[:port] = port
end
# Binding address
- opts.on( '-b', '--binding IP', 'Binds to the specified ip' ) do |binding|
- $settings[:binding] = binding
+ opts.on( '-b', '--binding IP', "Binds to the specified ip " \
+ "(default is #{$settings[:binding]})" ) do |binding|
+ $settings[:binding] = binding
+ end
+ # Help
+ opts.on( '-h', '--help', 'Shows this help message' ) do
+ puts opts
+ exit
end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.