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

Function main

lib_acl_cpp/samples/scan_rmdir/main.cpp:150–201  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

148}
149
150int main(int argc, char* argv[])
151{
152 int ch;
153 bool rmdir_on = false, recursive = false, use_class = false;
154 acl::string path;
155 acl::log::stdout_open(true);
156
157 while ((ch = getopt(argc, argv, "hd:raRC")) > 0) {
158 switch (ch) {
159 case 'h':
160 usage(argv[0]);
161 return 0;
162 case 'd':
163 path = optarg;
164 break;
165 case 'r':
166 recursive = true;
167 break;
168 case 'R':
169 rmdir_on = true;
170 break;
171 case 'C':
172 use_class = true;
173 break;
174 default:
175 break;
176 }
177 }
178
179 if (path.empty()) {
180 usage(argv[0]);
181 return 1;
182 }
183
184 if (!path.end_with("/")) {
185 path += "/";
186 }
187
188 if (use_class) {
189 rmdir_on_empty(path, recursive, rmdir_on);
190 } else {
191 rmdir_on_empty2(path, recursive, rmdir_on);
192 }
193
194#ifdef WIN32
195 printf("========================================================\r\n");
196 printf("enter any key to exit!\r\n");
197 getchar();
198#endif
199
200 return (0);
201}

Callers

nothing calls this directly

Calls 6

rmdir_on_emptyFunction · 0.85
rmdir_on_empty2Function · 0.85
end_withMethod · 0.80
usageFunction · 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…