8 |
|
#include "Collector.hpp" |
9 |
|
#include "Publisher.hpp" |
10 |
|
|
11 |
+ |
enum Color { reset, bright, dim, underscore = 4, blink, reverse = 7, hidden, |
12 |
+ |
black = 30, red, green, yellow, blue, magenta, cyan, white, _black = 40, |
13 |
+ |
_red, _green, _yellow, _blue, _magenta, _cyan, _white }; |
14 |
+ |
|
15 |
+ |
inline std::ostream& operator<<(std::ostream& sout, Color color) |
16 |
+ |
{ |
17 |
+ |
sout << "\033[" << unsigned(color) << 'm'; |
18 |
+ |
|
19 |
+ |
return sout; |
20 |
+ |
} |
21 |
+ |
|
22 |
|
int main(int argc, char* argv[]) |
23 |
|
{ |
24 |
|
Zoe::program = argv[0]; |
46 |
|
} |
47 |
|
else |
48 |
|
{ |
49 |
< |
cerr << "Usage: " << Zoe::program << " [-config=config] [-collector" |
50 |
< |
<< "] [-publisher] [-D]\n"; |
49 |
> |
cerr << bright << "Usage: " << cyan << Zoe::program << reset << " [" |
50 |
> |
<< bright << blue << "-config=" << yellow << "config" << reset |
51 |
> |
<< "] [" << bright << blue << "-collector" << reset << "] [" |
52 |
> |
<< bright << blue << "-publisher" << reset << "] [" << bright |
53 |
> |
<< blue << "-D" << reset << "]\n"; |
54 |
|
|
55 |
|
return 1; |
56 |
|
} |
65 |
|
{ |
66 |
|
configure(); |
67 |
|
|
68 |
< |
if (collector) Collector collector(buddies); |
69 |
< |
if (publisher) Publisher publisher(buddies); |
68 |
> |
Collector collector(login, password, buddies, Zoe::collector); |
69 |
> |
Publisher publisher(buddies, Zoe::publisher); |
70 |
|
} |
71 |
|
|
72 |
|
bool Zoe::debug(false), Zoe::collector(false), Zoe::publisher(false); |