writedb.rb
Path: db/writedb.rb
Modified: Sun Apr 06 11:50:24 MDT 2003
Required files
optparse    shellwords    db/builddb    db/listdiscs    db/readnames    db/dbsort   
Methods
main    start   
Classes and Modules
Class BuildDB
Class WriteDbParser
Public Instance methods
main(opts, args)

main(): application itself starts here. Writes to stdout if no output file given on command line.

# File db/writedb.rb, line 110
def main(opts, args)
  
  mydb = BuildDB.new
  mydb.initdb
  mydb.writedb(args.size > 0 ? 
	       File::new(args[0], File::WRONLY|File::CREAT|File::TRUNC) : 
	       STDOUT)
  return 0
end
start(av)

Entry point if called as executable.

# File db/writedb.rb, line 208
def start(av)
  opts = WriteDbParser.new(USAGE, BANNER)
  main(opts.vals, opts.parse(av))
end