Skip to content

Commit f5e9472

Browse files
committed
Revert "🚧 figure out why this breaks tests"
This reverts commit 6581f10.
1 parent 6581f10 commit f5e9472

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

augur/argparse_.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def run(args):
3333
parser.set_defaults(__command__ = default_command)
3434

3535

36-
def register_commands(parser: argparse.ArgumentParser, commands):
36+
def register_commands(parser: argparse.ArgumentParser, commands, command_attribute='__command__'):
3737
"""
3838
Add subparsers for each command module.
3939
@@ -56,6 +56,10 @@ def register_commands(parser: argparse.ArgumentParser, commands):
5656
# Allow each command to register its own subparser
5757
subparser = command.register_parser(subparsers)
5858

59+
# Add default attribute for command module
60+
if command_attribute:
61+
subparser.set_defaults(**{command_attribute: command})
62+
5963
# Ensure all subparsers format like the top-level parser
6064
subparser.formatter_class = parser.formatter_class
6165

augur/curate/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from . import format_dates, normalize_strings, passthru, titlecase, apply_geolocation_rules, apply_record_annotations, abbreviate_authors, parse_genbank_location, transform_strain_name, rename
55

66

7+
SUBCOMMAND_ATTRIBUTE = '_curate_subcommand'
78
SUBCOMMANDS = [
89
passthru,
910
normalize_strings,

0 commit comments

Comments
 (0)