aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--quarg/actions.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/quarg/actions.py b/quarg/actions.py
index 9361ac2..70cde03 100644
--- a/quarg/actions.py
+++ b/quarg/actions.py
@@ -13,7 +13,9 @@ class ParseEnum(argparse.Action, metaclass=ABCMeta):
def __call__(self, parser, namespace, value, option_string=None):
key = value.upper()
if key not in self.enumclass.__members__:
- errx(f'Not a valid {self.enumclass.describe()}: {value}')
+ possible = ', '.join([e.name.lower() for e in self.enumclass])
+ desc = self.enumclass.describe()
+ errx(f'Not a valid {desc}: {value}\nPossible {desc}s are: {possible}')
saved = getattr(namespace, self.dest) or []
saved.append(self.enumclass[key])