| 85 | #define QUOTE(x) QUOTE_(x) |
| 86 | |
| 87 | int main(int argc, char *argv[]) |
| 88 | { |
| 89 | extern char *optarg; |
| 90 | extern int optind, optopt; |
| 91 | |
| 92 | enum class Mode {create, extract, partial_create, partial_restore, none}; |
| 93 | Mode mode = Mode::none; |
| 94 | |
| 95 | int c; |
| 96 | |
| 97 | bool disable_log_deletion = true; |
| 98 | bool support_files_only = false; |
| 99 | bool strip_cluster_info = false; |
| 100 | bool strip_consumer_info = false; |
| 101 | bool run_full_recovery = true; |
| 102 | bool run_with_done_file = false; |
| 103 | bool force_mode = false; |
| 104 | unsigned percent_full = 95; |
| 105 | bool legacy_mode = false; |
| 106 | bool add_latency = false; |
| 107 | bool do_direct_io = true; |
| 108 | bool incr_create = false; |
| 109 | bool incr_gen = false; |
| 110 | bool incr_ex = false; |
| 111 | std::string incr_path; |
| 112 | bool incr_path_specified = false; |
| 113 | bool dryrun = false; |
| 114 | bool copy_physical = false; |
| 115 | |
| 116 | std::string new_db_name = ""; |
| 117 | std::string new_type = "default"; |
| 118 | |
| 119 | // TODO: should really consider using comdb2file.c |
| 120 | char *s = getenv("COMDB2_ROOT"); |
| 121 | std::string root; |
| 122 | if (s == NULL) |
| 123 | root = QUOTE(COMDB2_ROOT); |
| 124 | else |
| 125 | root = s; |
| 126 | |
| 127 | std::ostringstream ss; |
| 128 | ss << root << "/bin/comdb2"; |
| 129 | std::string comdb2_task(ss.str()); |
| 130 | |
| 131 | while((c = getopt(argc, argv, "hsSLC:I:b:x:u:rRSkKfODE:T:A")) != EOF) { |
| 132 | switch(c) { |
| 133 | case 'O': |
| 134 | legacy_mode = true; |
| 135 | break; |
| 136 | |
| 137 | case 'A': |
| 138 | add_latency = true; |
| 139 | break; |
| 140 | |
| 141 | case 'h': |
| 142 | usage(); |
| 143 | std::exit(0); |
| 144 | break; |
nothing calls this directly
no test coverage detected