diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2021-01-29 18:50:12 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2021-01-29 18:50:12 -0300 |
commit | 6142e853fa2cf1c1be695ca7cce121e48b177d7b (patch) | |
tree | c9741dadfae904ae3d9880b86080e5fdb8963cee /csv-sampler.py | |
parent | a1698ec97a1c473925cf42526c23882e279a48d1 (diff) | |
download | csv-hasher-6142e853fa2cf1c1be695ca7cce121e48b177d7b.tar.gz csv-hasher-6142e853fa2cf1c1be695ca7cce121e48b177d7b.tar.bz2 |
Feat: change default and test params; use return status
Diffstat (limited to 'csv-sampler.py')
-rwxr-xr-x | csv-sampler.py | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/csv-sampler.py b/csv-sampler.py index 35d82db..fa861a8 100755 --- a/csv-sampler.py +++ b/csv-sampler.py @@ -66,7 +66,11 @@ def cmdline(): :return: Command line arguments. """ - basename = os.path.basename(__file__) + # Defaults + basename = os.path.basename(__file__) + rows_per_iteration = 1024 + iterations = 1024 + progress = True # Parse CLI #examples = "Examples:\n\t" + basename + " --no-progress \n" @@ -76,23 +80,23 @@ def cmdline(): epilog=epilog, formatter_class=argparse.RawDescriptionHelpFormatter,) - parser.add_argument('outfile', nargs=1, help='CSV output file name') + parser.add_argument('outfile', nargs=1, help='CSV output file name') parser.add_argument('--rows_per_iteration', dest='rows_per_iteration', - type=int, help='Rows per iteration, defaults to 1000') + type=int, help='Rows per iteration, defaults to ' + str(rows_per_iteration)) parser.add_argument('--iterations', dest='iterations', - help='Number of iterations, defaults to 1000') + help='Number of iterations, defaults to ' + str(iterations)) parser.add_argument('--progress', dest='progress', action='store_true', - help='Enable progress bar.') + help='Enable progress bar, defaults to ' + str(progress)) parser.add_argument('--no-progress', dest='progress', action='store_false', help='Disable progress bar.') # Add default values and get args - parser.set_defaults(rows_per_iteration=1000) - parser.set_defaults(iterations=1000) + parser.set_defaults(rows_per_iteration=rows_per_iteration) + parser.set_defaults(iterations=iterations) parser.set_defaults(progress=True) args = parser.parse_args() |