diff options
author | steven.bethard <devnull@localhost> | 2009-10-24 15:54:32 +0000 |
---|---|---|
committer | steven.bethard <devnull@localhost> | 2009-10-24 15:54:32 +0000 |
commit | 57dee9ad3d9f5621f7136988d167edcce2db6100 (patch) | |
tree | 7062a1fd4d2d2dd8426504be1b7c356fb0a81682 /argparse.py | |
parent | bc9332c5e33065a637797d739363236b01eb57d3 (diff) | |
download | argparse-57dee9ad3d9f5621f7136988d167edcce2db6100.tar.gz |
Better error messages when 'dest' occurs twice for positional arguments
Diffstat (limited to 'argparse.py')
-rw-r--r-- | argparse.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/argparse.py b/argparse.py index 503cbaf..3cc3b6a 100644 --- a/argparse.py +++ b/argparse.py @@ -1249,6 +1249,8 @@ class _ActionsContainer(object): # argument chars = self.prefix_chars if not args or len(args) == 1 and args[0][0] not in chars: + if args and 'dest' in kwargs: + raise ValueError('dest supplied twice for positional argument') kwargs = self._get_positional_kwargs(*args, **kwargs) # otherwise, we're adding an optional argument |