Sha256: 451bc5e341841882e413be58325428f549185072fb85b71856308ac2f62aff38
Contents?: true
Size: 948 Bytes
Versions: 4
Compression:
Stored size: 948 Bytes
Contents
#! /usr/bin/ruby require 'optparse' require 'rubygems' require 'ole/storage' def oletool opts = {:verbose => false, :action => :tree} op = OptionParser.new do |op| op.banner = "Usage: oletool [options] [files]" op.separator '' op.on('-t', '--tree', 'Dump ole trees for files (default)') { opts[:action] = :tree } op.on('-r', '--repack', 'Repack the ole files in canonical form') { opts[:action] = :repack } op.separator '' op.on('-v', '--[no-]verbose', 'Run verbosely') { |v| opts[:verbose] = v } op.on_tail('-h', '--help', 'Show this message') { puts op; exit } end files = op.parse ARGV if files.empty? puts 'Must specify 1 or more msg files.' puts op exit 1 end Ole::Log.level = opts[:verbose] ? Logger::WARN : Logger::FATAL files.each do |file| case opts[:action] when :tree Ole::Storage.open(file) { |ole| puts ole.root.to_tree } when :repack Ole::Storage.open(file, &:repack) end end end oletool
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
ruby-msg-1.2.17.2 | bin/oletool |
ruby-msg-1.2.17.1 | bin/oletool |
ruby-msg-1.2.17.3 | bin/oletool |
ruby-msg-1.2.17 | bin/oletool |