Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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(
'-i', '--ignore-file', metavar='',
type=str, default=None,
help='input text file with URLs to exclude from extraction')
parser.add_argument(
'input_file', nargs='?', metavar='',
type=argparse.FileType(), default=sys.stdin,
help='input text file with URLs to extract')