code: def _urlextract_cli():
      
      import argparse
  
      def get_args():
          """
          Parse programs arguments
          """
          parser = argparse.ArgumentParser(
              description='urlextract - prints out all URLs that were '
                          'found in input file or stdin based on locating '
                          'their TLDs')
  
          ver = URLExtract.get_version()
          parser.add_argument("-v", "--version", action="version",
                              version='%(prog)s - version {}'.format(ver))
  
          parser.add_argument(
              "-u", "--unique", dest='unique', action='store_true',
              help='print out only unique URLs found in file.')
  
          parser.add_argument(
              'input_file', nargs='?', metavar='<input_file>',
              type=argparse.FileType(encoding="UTF-8"), default=sys.stdin,
              help='input text file with URLs to extract. [UTF-8]')
  
          parsed_args = parser.parse_args()
          return parsed_args
  
      args = get_args()
      logging.basicConfig(
          level=logging.INFO, stream=sys.stderr,
          format='%(asctime)s - %(levelname)s (%(name)s): %(message)s')
      logger = logging.getLogger('urlextract')
  
      try:
          urlextract = URLExtract()
          urlextract.update_when_older(30)
          content = args.input_file.read()
          for url in urlextract.find_urls(content, args.unique):
              print(url)
      except CacheFileError as e:
          logger.error(str(e))
          sys.exit(-1)
      finally:
          args.input_file.close()
docs: urlextract - command line program that will print all URLs to stdout
      Usage: urlextract [input_file] [-u] [-v]
  
      input_file - text file with URLs to extract