scripts: generate-alt-random-writes: add command line arguments for cols/rows

This commit is contained in:
Daniel Eklöf 2020-11-15 13:49:06 +01:00
parent cc850ed012
commit 66527b39b1
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -18,6 +18,8 @@ def main():
parser = argparse.ArgumentParser()
parser.add_argument(
'out', type=argparse.FileType(mode='w'), nargs='?', help='name of output file')
parser.add_argument('--cols', type=int)
parser.add_argument('--rows', type=int)
parser.add_argument('--colors-regular', action='store_true')
parser.add_argument('--colors-bright', action='store_true')
parser.add_argument('--colors-rgb', action='store_true')
@ -33,6 +35,11 @@ def main():
termios.TIOCGWINSZ,
struct.pack('HHHH', 0, 0, 0, 0)))
if opts.rows is not None:
lines = opts.rows
if opts.cols is not None:
cols = opts.cols
# Number of characters to write to screen
count = 256 * 1024**1