Exemplo n.º 1
0
def parser():
    parser = ArgParser(
        description=
        'Utility to check passwords against the list from haveibeenpwned.com')
    parser.add_argument(
        '--pw_list_path',
        '-p',
        metavar='PATH',
        default=LIST_PATH,
        help=
        'Path to the file that contains the hashed password list (default: %(default)s)'
    )

    src_group = parser.add_mutually_exclusive_group()
    src_group.add_argument('--from_file',
                           '-f',
                           metavar='PATH',
                           help='Path to a KeePass csv file to check')
    src_group.add_argument(
        '--non_confidential',
        '-C',
        nargs='+',
        help='One or more non-confidential passwords to test')

    parser.include_common_args('verbosity', 'dry_run')
    return parser
Exemplo n.º 2
0
def parser():
    parser = ArgParser(description='Tool for testing ANSI colors')
    parser.add_argument(
        '--text',
        '-t',
        help=
        'Text to be displayed (default: the number of the color being shown)')

    parser.add_argument(
        '--color',
        '-c',
        help='Text color to use (default: cycle through 0-256)')
    parser.add_argument('--background',
                        '-b',
                        help='Background color to use (default: None)')
    parser.add_argument('--attr',
                        '-a',
                        choices=ATTRS,
                        help='Background color to use (default: None)')

    parser.add_argument(
        '--all',
        '-A',
        action='store_true',
        help=
        'Show all forground and background colors (only when no color/background is specified)'
    )
    parser.add_argument('--limit',
                        '-L',
                        type=int,
                        default=256,
                        help='Range limit')

    mparser = parser.add_mutually_exclusive_group()
    mparser.add_argument(
        '--basic',
        '-B',
        action='store_true',
        help=
        'Display colors without the 38;5; prefix (cannot be combined with other args)'
    )
    mparser.add_argument(
        '--hex',
        '-H',
        action='store_true',
        help='Display colors by hex value (cannot be combined with other args)'
    )

    return parser