Skip to content

Commit 1fd9388

Browse files
cr1901whitequark
authored andcommitted
Improve Amaranth CLI message when given component name fails to match regex.
1 parent 7ff2e44 commit 1fd9388

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

amaranth_cli/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ def component(reference):
3434
raise argparse.ArgumentTypeError(f"'{qual_name}:{mod_name}' refers to an object that is not elaboratable")
3535
return obj
3636
else:
37-
raise argparse.ArgumentTypeError(f"{reference!r} is not a Python object reference")
37+
raise argparse.ArgumentTypeError(f"{reference!r} can not be parsed as a Python object reference, "
38+
"expecting a name like: 'path.to.module:ObjectInModule'")
3839

3940
parser = argparse.ArgumentParser(
4041
"amaranth", description="""

0 commit comments

Comments
 (0)