File: app_exit.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 (16 lines) | stat: -rw-r--r-- 325 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
  #!/usr/bin/env ruby

  require 'rubygems'
  require 'commandline'

  class App < CommandLine::Application
    def initialize
      options :help, :debug
      option  :names => "--file", :opt_found => get_args
    end

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