Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

Commit

Permalink
fix subcommand addition
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Neumann committed Mar 23, 2018
1 parent 1e8bca8 commit f403207
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions allennlp/commands/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,13 @@ def main(prog: str = None,

args = parser.parse_args()

# Import any additional modules needed (to register custom classes).
for package_name in args.include_package:
import_submodules(package_name)

# If a subparser is triggered, it adds its work as `args.func`.
# So if no such attribute has been added, no subparser was triggered,
# so give the user some help.
if 'func' in dir(args):
# Import any additional modules needed (to register custom classes).
for package_name in args.include_package:
import_submodules(package_name)
args.func(args)
else:
parser.print_help()

0 comments on commit f403207

Please sign in to comment.