File: app_file.rb

package info (click to toggle)
libcommandline-ruby 0.7.10-6
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 556 kB
  • ctags: 289
  • sloc: ruby: 2,881; makefile: 5
file content (24 lines) | stat: -rw-r--r-- 701 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
  #!/usr/bin/env ruby

  require 'rubygems'
  require 'commandline'

  class App < CommandLine::Application
    def initialize
      author    "Author Name"
      copyright "Author Name, 2005"
      synopsis "[-dh] [--in-file <in_file>] file"
      short_description "Example application with one arg"
      long_description "put your long description here!"
      options :help, :debug
      option  :names => "--in-file", :opt_found => get_args,
              :opt_description => "Input file for sample app.",
              :arg_description => "input_file"
      expected_args :file
    end

    def main
      puts "args: #{args}"
      puts "--in-file: #{opt "--in-file"}"
    end
  end#class App