diff options
-rw-r--r-- | argparse.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/argparse.py b/argparse.py index 89d6f49..1996f46 100644 --- a/argparse.py +++ b/argparse.py @@ -787,7 +787,9 @@ class _StoreAction(Action): help=None, metavar=None): if nargs == 0: - raise ValueError('nargs must be > 0') + raise ValueError('nargs for store actions must be > 0; if you ' + 'have nothing to store, actions such as store ' + 'true or store const may be more appropriate') if const is not None and nargs != OPTIONAL: raise ValueError('nargs must be %r to supply const' % OPTIONAL) super(_StoreAction, self).__init__( @@ -877,7 +879,9 @@ class _AppendAction(Action): help=None, metavar=None): if nargs == 0: - raise ValueError('nargs must be > 0') + raise ValueError('nargs for append actions must be > 0; if arg ' + 'strings are not supplying the value to append, ' + 'the append const action may be more appropriate') if const is not None and nargs != OPTIONAL: raise ValueError('nargs must be %r to supply const' % OPTIONAL) super(_AppendAction, self).__init__( |