Skip to content

Commit c850a57

Browse files
themavikcursoragent
andcommitted
fix: make -m/--mode a required argument
When no -m flag is provided, args.mode is None (since action='append' defaults to None). This causes a TypeError in print_summary() which iterates over args.mode. Mark the argument as required=True so argparse emits a clear usage error instead of crashing with an unhelpful traceback. Also remove "[default]" from the help text for mode 0 since there is no longer a default. Fixes #32 Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 4371e0d commit c850a57

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/flexidot/utils/args.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ def parse_args():
8282
'--mode',
8383
action='append',
8484
choices=['0', '1', '2'],
85-
help='Mode of FlexiDot dotplotting. 0 = self [default], 1 = paired, 2 = poly (matrix with all-against-all dotplots). Call -m multiple times to run multiple modes.',
85+
required=True,
86+
help='Mode of FlexiDot dotplotting. 0 = self, 1 = paired, 2 = poly (matrix with all-against-all dotplots). Call -m multiple times to run multiple modes.',
8687
)
8788
parser.add_argument(
8889
'-t',

0 commit comments

Comments
 (0)