env and env_init: Eliminate weird auto-initialization of globals.

Merge the two files into env, and make each command explicitly call the
function that sets it up in the way that's needed for that command.

This means we can finally just import all the modules at the top of
each file, without worrying about import order.  Phew.

While we're here, remove the weird auto-appending-'all'-to-targets
feature in env.init().  Instead, do it explicitly, and only from redo and
redo-ifchange, only if is_toplevel and no other targets are given.
This commit is contained in:
Avery Pennarun 2018-12-05 01:07:16 -05:00
commit 9b6d1eeb6e
19 changed files with 267 additions and 256 deletions

View file

@ -1,9 +1,10 @@
import sys, os
import state
import env, state
from logs import err
def main():
env.inherit()
if len(sys.argv[1:]) < 2:
err('%s: at least 2 arguments expected.\n' % sys.argv[0])
sys.exit(1)