2 * Copyright 2011, Oliver Tappe <zooey@hirschkaefer.de>
3 * Distributed under the terms of the MIT License.
9 #include "JobStateListener.h"
13 using BSupportKit::BJob
;
16 JobStateListener::JobStateListener(uint32 flags
)
24 JobStateListener::JobStarted(BJob
* job
)
26 printf("%s ...\n", job
->Title().String());
31 JobStateListener::JobSucceeded(BJob
* job
)
37 JobStateListener::JobFailed(BJob
* job
)
39 BString error
= job
->ErrorString();
40 if (error
.Length() > 0) {
41 error
.ReplaceAll("\n", "\n*** ");
42 fprintf(stderr
, "%s", error
.String());
44 if ((fFlags
& EXIT_ON_ERROR
) != 0)
45 DIE(job
->Result(), "failed!");
50 JobStateListener::JobAborted(BJob
* job
)
52 if ((fFlags
& EXIT_ON_ABORT
) != 0)
53 DIE(job
->Result(), "aborted");