A
Aldric Giacomoni
So, I followed the tutorial and got this far..
http://rubyforge.org/docman/view.php/632/233/posted-docs.index.html
Now, I can't figure out how I get these options out of this class and
into my code! A little help is appreciated, please
class Options < CommandLine::Application
def initialize
synopsis "[-aX] etc etc"
short_description "a 1"
long_description "This program is intended to be run from the Fusion
server. It will"
options :help
option :names => ["-a", "--LogAge"],
pt_found => get_args,
pt_description => "How many months to keep unzipped.",
:arg_description => "integer"
option :names => ["-t", "--to"],
pt_found => get_args,
pt_description => "The recipient of the error logs",
:arg_description => "email address"
option :names => ["-f", "--from"],
pt_found => get_args,
pt_description => "The sender of the error logs",
:arg_description => "email address"
end
def main
puts "args: #{args}"
puts "-a #{opt["-a"]}"
puts "-t #{opt["-t"]}"
puts "-f #{opt["-f"]}"
end
end
--Aldric
http://rubyforge.org/docman/view.php/632/233/posted-docs.index.html
Now, I can't figure out how I get these options out of this class and
into my code! A little help is appreciated, please
class Options < CommandLine::Application
def initialize
synopsis "[-aX] etc etc"
short_description "a 1"
long_description "This program is intended to be run from the Fusion
server. It will"
options :help
option :names => ["-a", "--LogAge"],
:arg_description => "integer"
option :names => ["-t", "--to"],
:arg_description => "email address"
option :names => ["-f", "--from"],
:arg_description => "email address"
end
def main
puts "args: #{args}"
puts "-a #{opt["-a"]}"
puts "-t #{opt["-t"]}"
puts "-f #{opt["-f"]}"
end
end
--Aldric