Added some tail flags to the binary
[jello.git] / bin / jello
blobe874119fc18ccf60b467de084aeb0bb5d1dc2de7
1 #!/usr/bin/env ruby -Ku
2 ($:.unshift File.expand_path(File.join( File.dirname(__FILE__), '..', 'lib' ))).uniq!
3 %w[jello rubygems optparse].each {|dep| require dep }
5 options = Hash.new
6 OptionParser.new do |opts|
7 opts.banner = "\
8 = Jello =
10 Moulds may be any string that matches a part of a path of a Ruby file relative\
11 to one of the entries in the Jello search path:
12 - ~/.jello
13 - /etc/jello
14 - <`gem contents jello`>/moulds
16 If a file matches earlier in the search path, later ones that also match will\
17 be ignored.
19 A directory may match, in which case all Ruby files in that directory will be\
20 utilized.
22 The follow moulds are included for your enjoyment:
23 - jello say
24 - jello grabup
25 - jello shorten
27 == Usage ==
28 `jello [options] <mould> (<mould> <mould> …)`
31 opts.on("-v", "--[no-]verbose", "Run verbosely") do |v|
32 options[:verbose] = v
33 end
35 opts.on("-d", "--[no-]debug", "Run extremely verbosely") do |d|
36 $-d = d
37 end
39 opts.on("-f", "--[no-]feedback", "Feedback on successful process") do |f|
40 options[:feedback] = f
41 end
43 opts.on("-p", "--period PERIOD", "Period over which to cycle watcher process") do |p|
44 options[:period] = p
45 end
47 opts.on_tail("--help", "Show this help") do
48 puts opts
49 exit
50 end
51 opts.on_tail("--version", "Show version") do
52 puts "I'm Jello #{Jello::Version}!"
53 exit
54 end
55 end.parse!
57 ARGV.each do |mould|
58 require Jello::Mould.find(mould)
59 end
61 Jello.start! options