-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
44 lines (39 loc) · 977 Bytes
/
Copy pathmain.cpp
File metadata and controls
44 lines (39 loc) · 977 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#include <iostream>
#include "waf-ghc.h"
#define RESET "\033[0m"
#define RED "\033[31m"
#define GREEN "\033[32m"
#define CYAN "\033[36m"
#define YELLOW "\033[33m"
int main(int argc, char *argv[]) {
WafGhc waf;
if (argc < 2) {
std::cout << RED << "Error: No command provided.\n" << RESET;
waf.printManual();
return 1;
}
std::string command = argv[1];
if (command == "--version") {
waf.showVersion();
}
else if (command == "--user-add") {
waf.addUser();
}
else if (command == "--user-remove") {
waf.removeUser();
}
else if (command == "--user-pass") {
waf.changeUserPassword();
}
else if (command == "--check") {
waf.checkStatus();
}
else if (command == "--uninstall") {
waf.uninstall();
}
else {
std::cout << RED << "Error: Unknown command \"" << command << "\".\n" << RESET;
waf.printManual();
}
return 0;
}