git-svn-id: file:///home/svn/incoming/trunk@2936 4d416f70-5f16-0410-b530-b9f4589650da
unstable
Matt Miller 2005-10-01 21:32:11 +00:00
parent 4f1aaeabd6
commit cc23a249db
1 changed files with 9 additions and 1 deletions

View File

@ -67,7 +67,7 @@ end
# Nuff said.
#
def usage
$stderr.puts("\n" + " Usage: #{$0} <options> [var=val]\n" + $args.usage)
$stderr.puts("\n" + " Usage: #{$0} <options>\n" + $args.usage)
exit
end
@ -84,6 +84,7 @@ space = nil
encoder = nil
fmt = "c"
input = $stdin
options = ''
# Parse the argument and rock that shit.
$args.parse(ARGV) { |opt, idx, val|
@ -116,6 +117,10 @@ $args.parse(ARGV) { |opt, idx, val|
encoder = val
when "-h"
usage
else
if (val =~ /=/)
options += ((options.length > 0) ? "," : "") + "#{val}"
end
end
}
@ -139,6 +144,9 @@ case cmd
encoders.each { |enc|
begin
# Imports options
enc.datastore.import_options_from_s(options)
# Encode it upt
raw = enc.encode(buf, badchars)