Make calls to logs.setup() explicit in each cmd.

Further reducing magic implicit behaviour to make code easier to
follow.
This commit is contained in:
Avery Pennarun 2018-12-11 00:55:05 +00:00
commit 4d2b4cfccb
12 changed files with 49 additions and 39 deletions

View file

@ -1,14 +1,16 @@
import sys, os
from . import env, paths
from . import env, logs, paths
from .logs import err
def main():
env.init_no_state()
if len(sys.argv[1:]) != 1:
err('%s: exactly one argument expected.\n' % sys.argv[0])
sys.stderr.write('%s: exactly one argument expected.\n' % sys.argv[0])
sys.exit(1)
env.init_no_state()
logs.setup(tty=sys.stderr, pretty=env.v.PRETTY, color=env.v.COLOR)
want = sys.argv[1]
if not want:
err('cannot build the empty target ("").\n')