From 411f7649364b728bc5836416bc9b9564dbcd291f Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Fri, 21 Jun 2013 15:09:52 -0700 Subject: [PATCH] install.py: add note about parse_known_args --- bin/install.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/bin/install.py b/bin/install.py index 3fdd5be3b..2ca62f233 100755 --- a/bin/install.py +++ b/bin/install.py @@ -142,6 +142,16 @@ def parse_args(args): action="store_true", dest="version" ) + + # Use parse_known_args for maximum compatibility with + # getopt handling of non-option file arguments. Note + # that parser.add_argument("files", nargs='+') would + # be subtly incompatible because it requires that all + # of the file arguments be grouped sequentially. Also + # note that we have to explicitly call add_argument + # for known options in order for argparse to correctly + # separate option arguments from file arguments in all + # cases (it also allows for optparse compatibility). parsed_args = parser.parse_known_args() opts = parsed_args[0] -- 2.26.2