Annotation of ruby/pirc/pirc.rb, revision 1.1
1.1 ! as 1: #!/usr/bin/env ruby
! 2: #
! 3: # Copyright (c) 2007 Aron Schlesinger
! 4: # All rights reserved.
! 5: #
! 6: # Redistribution and use in source and binary forms, with or without
! 7: # modification, are permitted provided that the following conditions
! 8: # are met:
! 9: # 1. Redistributions of source code must retain the above copyright
! 10: # notice, this list of conditions and the following disclaimer.
! 11: # 2. Redistributions in binary form must reproduce the above copyright
! 12: # notice, this list of conditions and the following disclaimer in the
! 13: # documentation and/or other materials provided with the distribution.
! 14: #
! 15: # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS''
! 16: # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO
! 17: # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
! 18: # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS
! 19: # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
! 20: # OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
! 21: # OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
! 22: # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
! 23: # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
! 24: # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
! 25: # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
! 26: #
! 27: # $Paefchen: ruby/irc/pirc.rb,v 1.3 2007/09/21 03:52:00 as Exp $
! 28:
! 29: require 'pirc/pircc'
! 30: require 'getoptlong'
! 31:
! 32: PIRC::DEBUG = true
! 33: PIRC::DEBUG_TRACE = true
! 34:
! 35: begin
! 36: (opts = GetoptLong.new(
! 37: [ '--user', '-u', GetoptLong::REQUIRED_ARGUMENT ],
! 38: [ '--nick', '-n', GetoptLong::REQUIRED_ARGUMENT ]
! 39: )).quiet = true
! 40:
! 41: args = {}
! 42: opts.each do |arg, value|
! 43: args[arg[2..-1].to_sym] = value
! 44: end
! 45:
! 46: PIRC::PIRCC.new( args ).run
! 47:
! 48: rescue => e
! 49: $stderr.puts sprintf('%s: %s => %s', File.basename($0), e.class, e.message)
! 50: end
! 51:
! 52: #EOF