MCPcopy Create free account
hub / github.com/acl-dev/acl / main

Function main

app/wizard/wizard.cpp:37–98  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35}
36
37int main(int argc, char* argv[])
38{
39 int ch;
40 acl::string name, type, app("master");
41
42 while ((ch = getopt(argc, argv, "hn:t:a:")) > 0) {
43 switch (ch) {
44 case 'h':
45 usage(argv[0]);
46 return 0;
47 case 'n':
48 name = optarg;
49 break;
50 case 't':
51 type = optarg;
52 break;
53 case 'a':
54 app = optarg;
55 break;
56 default:
57 break;
58 }
59 }
60
61 acl::acl_cpp_init();
62
63 if (!name.empty() && !type.empty()) {
64 if (app == "master") {
65 return create_master_service(name, type);
66 } else if (app == "http") {
67 return create_http_service(name, type);
68 }
69 }
70
71 while (true) {
72 char buf[256];
73
74 printf("select one below:\r\n");
75 printf("m: master_service; d: db; h: http; q: exit\r\n");
76 printf(">"); fflush(stdout);
77
78 int n = acl_vstream_gets_nonl(ACL_VSTREAM_IN, buf, sizeof(buf));
79 if (n == ACL_VSTREAM_EOF) {
80 break;
81 }
82
83 if (strcasecmp(buf, "m") == 0) {
84 master_creator(NULL, NULL);
85 } else if (strcasecmp(buf, "d") == 0) {
86 create_db();
87 } else if (strcasecmp(buf, "h") == 0) {
88 http_creator(NULL, NULL);
89 } else if (strcasecmp(buf, "q") == 0) {
90 break;
91 } else {
92 printf("unknown %s\r\n", buf);
93 }
94 }

Callers

nothing calls this directly

Calls 10

acl_cpp_initFunction · 0.85
create_master_serviceFunction · 0.85
create_http_serviceFunction · 0.85
acl_vstream_gets_nonlFunction · 0.85
master_creatorFunction · 0.85
http_creatorFunction · 0.85
usageFunction · 0.70
create_dbFunction · 0.70
getoptFunction · 0.50
emptyMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…