Skip to content

Commit

Permalink
options
Browse files Browse the repository at this point in the history
git-svn-id: file:///home/svn/incoming/trunk@2936 4d416f70-5f16-0410-b530-b9f4589650da
  • Loading branch information
Matt Miller committed Oct 1, 2005
1 parent 4f1aaea commit cc23a24
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion msfencode
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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|
Expand Down Expand Up @@ -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
}

Expand All @@ -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)

Expand Down

0 comments on commit cc23a24

Please sign in to comment.