Code

Deprecate use of TIG_{MAIN,DIFF,LOG,TREE,BLOB}_CMD environment variables
[tig.git] / tig.c
diff --git a/tig.c b/tig.c
index a2fe255bfda8599b94c1d05c4d079cc01043ec35..01f48c35766cdcb1541513eef7f48d078cd6f0dc 100644 (file)
--- a/tig.c
+++ b/tig.c
@@ -7859,10 +7859,15 @@ main(int argc, const char *argv[])
        if (load_refs() == ERR)
                die("Failed to load refs.");
 
-       foreach_view (view, i)
+       foreach_view (view, i) {
+               if (getenv(view->cmd_env))
+                       warn("Use of the %s environment variable is deprecated,"
+                            " use options or TIG_DIFF_ARGS instead",
+                            view->cmd_env);
                if (!argv_from_env(view->ops->argv, view->cmd_env))
                        die("Too many arguments in the `%s` environment variable",
                            view->cmd_env);
+       }
 
        init_display();