Skip to content

Commit

Permalink
Revert "🚧 figure out why this breaks tests"
Browse files Browse the repository at this point in the history
This reverts commit 6581f10.
  • Loading branch information
victorlin committed Oct 31, 2024
1 parent 6581f10 commit f5e9472
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion augur/argparse_.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def run(args):
parser.set_defaults(__command__ = default_command)


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

# Add default attribute for command module
if command_attribute:
subparser.set_defaults(**{command_attribute: command})

# Ensure all subparsers format like the top-level parser
subparser.formatter_class = parser.formatter_class

Expand Down
1 change: 1 addition & 0 deletions augur/curate/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from . import format_dates, normalize_strings, passthru, titlecase, apply_geolocation_rules, apply_record_annotations, abbreviate_authors, parse_genbank_location, transform_strain_name, rename


SUBCOMMAND_ATTRIBUTE = '_curate_subcommand'
SUBCOMMANDS = [
passthru,
normalize_strings,
Expand Down

0 comments on commit f5e9472

Please sign in to comment.