Sha256: e8065ad6b7a3353ba692e66141a1e7c2db3f40e89872d00a8838a5af7d0c67b9

Contents?: true

Size: 380 Bytes

Versions: 4

Compression:

Stored size: 380 Bytes

Contents

#!/bin/env ruby

require "Getopt/Declare"

def encode(t)
    return Getopt::Declare.new(t,['-BUILD']).code
end

=begin
Just type in something, like:

=for Getopt::Declare

               -a              Append mode
=cut

=end

$/ = '=cut'
if t = $stdin.readline
  x = t.sub( /^=for\s+Getopt::Declare\s*\n(.*?)\n/esm ) { 
    '(self,source) = []'+encode("#$1") 
  }
  puts x
end


Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
getopt-declare-1.20 samples/cmdline_inlines.rb
getopt-declare-1.21 samples/cmdline_inlines.rb
getopt-declare-1.12 samples/cmdline_inlines.rb
getopt-declare-1.13 samples/cmdline_inlines.rb