@@ -1494,7 +1494,8 @@ def annotation_create(input_path, annotation_type,
1494
1494
name = 'annotation-remove' ,
1495
1495
short_help = 'Remove an Annotation from a QIIME 2 Result.' ,
1496
1496
help = 'Remove an existing Annotation (by name) from'
1497
- ' an Artifact or Visualization.'
1497
+ ' an Artifact or Visualization.' ,
1498
+ cls = ToolCommand
1498
1499
)
1499
1500
@click .option (
1500
1501
'--input-path' ,
@@ -1540,7 +1541,8 @@ def annotation_remove(input_path, name, output_path):
1540
1541
name = 'annotation-fetch' ,
1541
1542
short_help = 'Fetch an Annotation from a QIIME 2 Result.' ,
1542
1543
help = 'Fetch an existing Annotation (by name) from'
1543
- ' an Artifact or Visualization.'
1544
+ ' an Artifact or Visualization.' ,
1545
+ cls = ToolCommand
1544
1546
)
1545
1547
@click .option (
1546
1548
'--input-path' ,
@@ -1589,7 +1591,8 @@ def annotation_fetch(input_path, name, verbose):
1589
1591
name = 'annotation-list' ,
1590
1592
short_help = 'List Annotations on a QIIME 2 Result.' ,
1591
1593
help = 'List all Annotations that are attached to'
1592
- ' an Artifact or Visualization.'
1594
+ ' an Artifact or Visualization.' ,
1595
+ cls = ToolCommand
1593
1596
)
1594
1597
@click .option (
1595
1598
'--input-path' ,
@@ -1608,11 +1611,17 @@ def annotation_list(input_path):
1608
1611
result = qiime2 .sdk .Result .load (input_path )
1609
1612
1610
1613
try :
1611
- annotations = result .iter_annotations ()
1614
+ annotations_iter = result .iter_annotations ()
1612
1615
except Exception as e :
1613
1616
click .echo (CONFIG .cfg_style ('error' , str (e )), err = True )
1614
1617
raise click .Abort ()
1615
1618
1619
+ annotations = list (annotations_iter )
1620
+ # we may as well raise an error here to make it clear
1621
+ # that there are no annotations on the given result
1622
+ if not annotations :
1623
+ raise click .ClickException ("No Annotations found." )
1624
+
1616
1625
for annotation in annotations :
1617
1626
click .echo (CONFIG .cfg_style ('type' , "ID" )+ ": " , nl = False )
1618
1627
click .echo (annotation .id )
0 commit comments