code: def parse_args(args=None):
      
      from argparse import ArgumentParser
  
      if args is None:
          args = sys.argv
  
      parser = ArgumentParser(description='''
  Attempt to automatically find "adjacent" shapes in a SVG layer, and on a second
  SVG layer, draw each detected connection between the center points of the
  corresponding shapes.'''.strip())
      parser.add_argument('svg_input_file', type=path, default=None)
      parser.add_argument('svg_output_file', type=path, default="-",
                          help='Output file path ("-" for stdout)', nargs='?')
      parser.add_argument('-f', '--overwrite', action='store_true')
  
      args = parser.parse_args()
  
      if not args.overwrite and (args.svg_input_file == args.svg_output_file):
          parser.error('Input and output file are the same.  Use `-f` to force '
                       'overwrite.')
  
      return args
docs: Parses arguments, returns (options, args).