]> granicus.if.org Git - llvm/commitdiff
[lit] Add comment explaining the LIT_OPTS env var overrides command line options
authorJulian Lettner <jlettner@apple.com>
Thu, 10 Oct 2019 20:23:28 +0000 (20:23 +0000)
committerJulian Lettner <jlettner@apple.com>
Thu, 10 Oct 2019 20:23:28 +0000 (20:23 +0000)
Normally, command line options override environment variables.  Add
comment to state that we are doing the reverse on purpose.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374441 91177308-0d34-0410-b5e6-96231b3b80d8

utils/lit/lit/cl_arguments.py

index e5435d60d4b6ac4d2309f44ba7b7114b7510d08a..29a4bfd522e604cfdbc74cb9aca2e0347c2ac020 100644 (file)
@@ -183,8 +183,10 @@ def parse_args():
             action="store_true",
             default=False)
 
-    opts = parser.parse_args(sys.argv[1:] +
-                             shlex.split(os.environ.get("LIT_OPTS", "")))
+    # LIT is special: environment variables override command line arguments.
+    env_args = shlex.split(os.environ.get("LIT_OPTS", ""))
+    args = sys.argv[1:] + env_args
+    opts = parser.parse_args(args)
 
     # Validate command line options
     if opts.echoAllCommands: