Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

- improve help message

- load files using absolute path with File.expand_path
  • Loading branch information...
commit 4c348e9ff5876a0c3df1bc978d7b06b02cda999b 1 parent 696df45
@gramos authored
Showing with 23 additions and 5 deletions.
  1. +2 −5 bin/imagetooth
  2. +21 −0 lib/arg_parser.rb
View
7 bin/imagetooth
@@ -17,15 +17,12 @@
lib_path = File.expand_path(File.dirname(__FILE__))
lib_path = File.join lib_path, "../lib"
-$LOAD_PATH << lib_path
-
require 'optparse'
-require 'image_tooth'
-require 'arg_parser'
+require File.join(lib_path, 'image_tooth')
+require File.join(lib_path, 'arg_parser')
require 'ostruct'
require 'pp'
-
opt = ArgParser.parse(ARGV)
if (opt.all and opt.folder)
View
21 lib/arg_parser.rb
@@ -2,6 +2,26 @@ class ArgParser
def self.parse(args)
options = OpenStruct.new
+ gen_img_help = <<-EOS
+ ImageTooth paints the faces of the tooth image on hash colors based.
+ The tooth's filename represents the faces painted,
+ The filename's characters are:
+
+ * w - White
+ * g - Green
+ * b - Blue
+ * n - Black
+ * r - Red
+ * t - To extract
+ * x - Extracted
+
+ and are ordered, begining on the upper face of the
+ the tooth and moving clockwise ending on the center face.
+
+ Example: imagetooth --image wrrgw.png --folder ./
+
+ EOS
+
opts = OptionParser.new do |opts|
opts.on("-a", "--all", "Generate all teeth images's combinations.") do |all|
options.all = all
@@ -16,6 +36,7 @@ def self.parse(args)
end
opts.on_tail("-h", "--help", "Show this message") do
+ puts gen_img_help
puts opts
exit
Please sign in to comment.
Something went wrong with that request. Please try again.