parameters: (args=None)
return_statement: return args
docstring: Sets options and returns arguments.
  
      @return: Name of input file and optionally of output file.
      @rtype: ( str, [str,] )
docstring_summary: Sets options and returns arguments.
docstring_tokens: Sets options and returns arguments .
function: def parseOptions(args=None):
      """
      Sets options and returns arguments.
  
      @return: Name of input file and optionally of output file.
      @rtype: ( str, [str,] )
      """
      global options
      pod = """
  
  =head1 OPTIONS
  
  =cut
      """
      optionParser = OptionParser("usage: %prog [option]... <xml> [<rst>]")
  
      pod = """
  
  =head2 General options
  
  =over 4
  
  =cut
      """
      generalGroup = OptionGroup(optionParser, pod2Head(pod),
                                 pod2Description(pod))
  
      pod = """
  
  =item B<-a> I<adornment>
  
  =item B<--adornment>=I<adornment>
  
  Configures title markup to use so different styles can be requested
  easily.
  
  The value of the parameter must be a string made up of a sequence of
  character pairs. The first character of a pair is C<o> (overline) or
  C<u> (underline) and the second character is the character to use for
  the markup.
  
  The first and the second character pair is used for document title and
  subtitle, the following pairs are used for section titles where the
  third pair is used for the top level section title.
  
  Defaults to C<o=o-u=u-u~u:u.u`>.
  
  =cut
      """
      generalGroup.add_option(default=None, *pod2OptionList(pod),
                              **pod2OptionKeywords(pod))
  
      pod = """
  
  =item B<-f> I<fold>
  
  =item B<--fold>=I<fold>
  
  Configures whether long text lines in paragraphs should be folded and
  to which length. This option is for input not coming from reST which
  may have no internal line feeds in plain text strings.
  
  If folding is enabled text strings not in a line feed preserving
  context are first white-space normalized and then broken according to
  the folding rules. Folding rules put out the first word and continue
  to do so with the following words unless the next word would cross
  the folding boundary. Words are delimited by white-space.
  
  Defaults to C<0>, i.e. no folding.
  
  =cut
      """
      generalGroup.add_option(type="int", default=None,
                              *pod2OptionList(pod), **pod2OptionKeywords(pod))
  
      pod = """
  
  =item B<-v>
  
  =item B<--verbose>
  
  Operate verbose.
  
  =cut
      """
      generalGroup.add_option(action="store_true",
                              *pod2OptionList(pod), **pod2OptionKeywords(pod))
      optionParser.add_option_group(generalGroup)
  
      pod = """
  
  =back
  
  =head2 Arguments
  
  =over 4
  
  =cut
      """
      argumentGroup = OptionGroup(optionParser, pod2Head(pod),
                                  pod2Description(pod))
      optionParser.add_option_group(argumentGroup)
  
      pod = """
  
  =item I<xml>
  
  The XML input file containing docutils XML.
  
  =cut
      """
  
      argument1Group = OptionGroup(optionParser, *pod2Argument(pod))
      optionParser.add_option_group(argument1Group)
  
      pod = """
  
  =item I<rst>
  
  The optional output file containing reStructuredText.
  
  If not given output is put to C<STDOUT>.
  
  =cut
      """
      argument2Group = OptionGroup(optionParser, *pod2Argument(pod))
      optionParser.add_option_group(argument2Group)
  
      pod = """
  
  =back
  
  =cut
      """
      ( options, args, ) = optionParser.parse_args(args=args)
  
      if len(args) < 1:
          optionParser.error("An input file is required")
      if len(args) > 2:
          optionParser.error("At most two arguments are allowed")
      if (options.adornment is not None
          and re.search('^([ou][]!"#$%&\'()*+,\-./:;<=>?@[\\^_`{|}~])+$',
                        options.adornment) is None):
          optionParser.error("Invalid adornment string given")
  
      return args
function_tokens: def parseOptions ( args = None ) : global options pod = """
  
  =head1 OPTIONS
  
  =cut
      """ optionParser = OptionParser ( "usage: %prog [option]... <xml> [<rst>]" ) pod = """
  
  =head2 General options
  
  =over 4
  
  =cut
      """ generalGroup = OptionGroup ( optionParser , pod2Head ( pod ) , pod2Description ( pod ) ) pod = """
  
  =item B<-a> I<adornment>
  
  =item B<--adornment>=I<adornment>
  
  Configures title markup to use so different styles can be requested
  easily.
  
  The value of the parameter must be a string made up of a sequence of
  character pairs. The first character of a pair is C<o> (overline) or
  C<u> (underline) and the second character is the character to use for
  the markup.
  
  The first and the second character pair is used for document title and
  subtitle, the following pairs are used for section titles where the
  third pair is used for the top level section title.
  
  Defaults to C<o=o-u=u-u~u:u.u`>.
  
  =cut
      """ generalGroup . add_option ( default = None , * pod2OptionList ( pod ) , * * pod2OptionKeywords ( pod ) ) pod = """
  
  =item B<-f> I<fold>
  
  =item B<--fold>=I<fold>
  
  Configures whether long text lines in paragraphs should be folded and
  to which length. This option is for input not coming from reST which
  may have no internal line feeds in plain text strings.
  
  If folding is enabled text strings not in a line feed preserving
  context are first white-space normalized and then broken according to
  the folding rules. Folding rules put out the first word and continue
  to do so with the following words unless the next word would cross
  the folding boundary. Words are delimited by white-space.
  
  Defaults to C<0>, i.e. no folding.
  
  =cut
      """ generalGroup . add_option ( type = "int" , default = None , * pod2OptionList ( pod ) , * * pod2OptionKeywords ( pod ) ) pod = """
  
  =item B<-v>
  
  =item B<--verbose>
  
  Operate verbose.
  
  =cut
      """ generalGroup . add_option ( action = "store_true" , * pod2OptionList ( pod ) , * * pod2OptionKeywords ( pod ) ) optionParser . add_option_group ( generalGroup ) pod = """
  
  =back
  
  =head2 Arguments
  
  =over 4
  
  =cut
      """ argumentGroup = OptionGroup ( optionParser , pod2Head ( pod ) , pod2Description ( pod ) ) optionParser . add_option_group ( argumentGroup ) pod = """
  
  =item I<xml>
  
  The XML input file containing docutils XML.
  
  =cut
      """ argument1Group = OptionGroup ( optionParser , * pod2Argument ( pod ) ) optionParser . add_option_group ( argument1Group ) pod = """
  
  =item I<rst>
  
  The optional output file containing reStructuredText.
  
  If not given output is put to C<STDOUT>.
  
  =cut
      """ argument2Group = OptionGroup ( optionParser , * pod2Argument ( pod ) ) optionParser . add_option_group ( argument2Group ) pod = """
  
  =back
  
  =cut
      """ ( options , args , ) = optionParser . parse_args ( args = args ) if len ( args ) < 1 : optionParser . error ( "An input file is required" ) if len ( args ) > 2 : optionParser . error ( "At most two arguments are allowed" ) if ( options . adornment is not None and re . search ( '^([ou][]!"#$%&\'()*+,\-./:;<=>?@[\\^_`{|}~])+$' , options . adornment ) is None ) : optionParser . error ( "Invalid adornment string given" ) return args