forked from rosa/hakurei
cmd/mbf: optional init verbosity
This output is generally not needed and only useful when debugging container machinery itself. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
@@ -21,6 +21,7 @@ type cache struct {
|
||||
|
||||
cures, jobs int
|
||||
hostAbstract, idle bool
|
||||
verboseInit bool
|
||||
|
||||
base string
|
||||
}
|
||||
@@ -45,6 +46,9 @@ func (cache *cache) open() (err error) {
|
||||
if cache.hostAbstract {
|
||||
flags |= pkg.CHostAbstract
|
||||
}
|
||||
if !cache.verboseInit {
|
||||
flags |= pkg.CSuppressInit
|
||||
}
|
||||
|
||||
done := make(chan struct{})
|
||||
defer close(done)
|
||||
|
||||
@@ -108,6 +108,10 @@ func main() {
|
||||
&flagCheck,
|
||||
"check", command.BoolFlag(true),
|
||||
"Run test suites",
|
||||
).Flag(
|
||||
&cm.verboseInit,
|
||||
"v", command.BoolFlag(false),
|
||||
"Do not suppress verbose output from init",
|
||||
).Flag(
|
||||
&cm.cures,
|
||||
"cures", command.IntFlag(0),
|
||||
@@ -710,6 +714,7 @@ func main() {
|
||||
z.Hostname = "localhost"
|
||||
z.Uid, z.Gid = (1<<10)-1, (1<<10)-1
|
||||
z.Stdin, z.Stdout, z.Stderr = os.Stdin, os.Stdout, os.Stderr
|
||||
z.Quiet = !cm.verboseInit
|
||||
if s, ok := os.LookupEnv("TERM"); ok {
|
||||
z.Env = append(z.Env, "TERM="+s)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user