From 32c3d7fbf8330f7befb6e12c77c6536eedff7012 Mon Sep 17 00:00:00 2001 From: Chris Rosenthal Date: Fri, 5 Apr 2024 15:22:51 -0700 Subject: [PATCH] accepts - for stdin --- taxtastic/subcommands/get_descendants.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/taxtastic/subcommands/get_descendants.py b/taxtastic/subcommands/get_descendants.py index e98e934..39e2145 100644 --- a/taxtastic/subcommands/get_descendants.py +++ b/taxtastic/subcommands/get_descendants.py @@ -38,8 +38,8 @@ def build_parser(parser): def action(args): # TODO: move this logic into the taxonomy.py object file - if os.path.isfile(args.taxids): - taxids = [i.strip() for i in open(args.taxids) if i] + if os.path.isfile(args.taxids) or args.taxids == '-': + taxids = [i.strip() for i in taxtastic.utils.Opener('rt')(args.taxids) if i] else: taxids = args.taxids.split(',') engine = sqlalchemy.create_engine(args.url, echo=args.verbosity > 3)