lib/rbst.rb
# Formats and prints the options from the docutils help in the way they'd be
# specified in RbST: strings, symbols and hashes.
Formats and prints the options from the docutils help in the way they'd be
specified in RbST: strings, symbols and hashes.
Formats and prints the options from the docutils help in the way they ' d be specified in RbST : strings symbols and hashes .
def print_options(format)
    help = execute("#{@@python_path} #{@@executables[format]} --help")
    help.gsub!(/(\-\-)([A-Za-z0-9]+)([=|\s])/, ':\2\3')
    help.gsub!(/(\-\-)([\w|\-]+)(\n)?[^=|\]]?/, '\'\2\'\3')
    help.gsub!(/\=/, ' => ')
    help.gsub!(/([^\w])\-(\w)([^\w])/, '\1:\2\1')
    help.gsub!(/(:\w) </, '\1 => <')
    puts help
  end
def print_options ( format ) help = execute ( "#{@@python_path} #{@@executables[format]} --help" ) help . gsub! ( / ( \- \- )([A-Za-z0-9]+)([=| \s ]) / , ':\2\3' ) help . gsub! ( / ( \- \- )([ \w | \- ]+)( \n )?[^=| \] ]? / , '\'\2\'\3' ) help . gsub! ( / \= / , ' => ' ) help . gsub! ( / ([^ \w ]) \- ( \w )([^ \w ]) / , '\1:\2\1' ) help . gsub! ( / (: \w ) < / , '\1 => <' ) puts help end
Formats and prints the options from the docutils help in the way they'd be
specified in RbST: strings, symbols and hashes.
Formats and prints the options from the docutils help in the way they ' d be specified in RbST : strings symbols and hashes .
# Convert non-hyphenated long options to symbols # Convert hyphenated long options to quoted strings # Convert equal signs to hashrocket # Convert short options to symbols # Convert short options with args get a hashrocket # Print converted help text
format