From: Zac Medico Date: Fri, 21 Jun 2013 22:09:52 +0000 (-0700) Subject: install.py: add note about parse_known_args X-Git-Tag: v2.2.0_alpha184~6 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=411f7649364b728bc5836416bc9b9564dbcd291f;p=portage.git install.py: add note about parse_known_args --- 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]