Add --count option.

This commit is contained in:
voussoir 2022-11-12 12:42:01 -08:00
parent 355c02cf7e
commit 3ddaa83edd

View file

@ -75,6 +75,7 @@ def random_hex(length):
return token return token
def passwordy_argparse(args): def passwordy_argparse(args):
for index in range(args.count):
if args.sentence: if args.sentence:
password = make_sentence(args.length, args.separator) password = make_sentence(args.length, args.separator)
else: else:
@ -155,6 +156,14 @@ def main(argv):
In normal mode, the --groups-of chunks will be joined with this string. In normal mode, the --groups-of chunks will be joined with this string.
''', ''',
) )
parser.add_argument(
'--count',
type=int,
default=1,
help='''
Generate this many passwords, to be printed out one per line.
''',
)
parser.add_argument( parser.add_argument(
'--letters', '--letters',
action='store_true', action='store_true',