MCPcopy Create free account
hub / github.com/bloomberg/comdb2 / main

Function main

tools/cdb2sql/cdb2sql.cpp:2000–2223  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1998}
1999
2000int main(int argc, char *argv[])
2001{
2002 static char *filename = NULL;
2003 static int precision = 0;
2004 static int exponent = 0;
2005 static int isttyarg = 0;
2006 static char *sql = NULL;
2007 int ntypes = 0;
2008 int *types = NULL;
2009 int opt_indx = 0;
2010 int c;
2011 int printtostderr = 0;
2012 int printcoltype = 0;
2013
2014 signal(SIGPIPE, SIG_IGN);
2015
2016 static struct option long_options[] = {
2017 {"pause", no_argument, &pausemode, 1},
2018 {"binary", no_argument, &printmode, DISP_BINARY},
2019 {"tabs", no_argument, &printmode, DISP_TABS},
2020 {"tabular", no_argument, &printmode, DISP_TABULAR},
2021 {"coltype", no_argument, &printcoltype, 1},
2022 {"stderr", no_argument, &printtostderr, 1},
2023 {"verbose", no_argument, &verbose, 1},
2024 {"strblobs", no_argument, &string_blobs, 1},
2025 {"debugtrace", no_argument, &debug_trace, 1},
2026 {"showports", no_argument, &show_ports, 1},
2027 {"showeffects", no_argument, &show_effects, 1},
2028 {"cost", no_argument, &docost, 1},
2029 {"exponent", no_argument, &exponent, 1},
2030 {"isatty", no_argument, &isttyarg, 1},
2031 {"isnotatty", no_argument, &isttyarg, 2},
2032 {"admin", no_argument, &isadmin, 1},
2033 {"help", no_argument, NULL, 'h'},
2034 {"script", no_argument, NULL, 's'},
2035 {"maxretries", required_argument, NULL, 'r'},
2036 {"precision", required_argument, NULL, 'p'},
2037 {"cdb2cfg", required_argument, NULL, 'c'},
2038 {"file", required_argument, NULL, 'f'},
2039 {"gensql", required_argument, NULL, 'g'},
2040 {"delim", required_argument, NULL, 'd'},
2041 {"type", required_argument, NULL, 't'},
2042 {"host", required_argument, NULL, 'n'},
2043 {"minretries", required_argument, NULL, 'R'},
2044 {"connect-to-master", no_argument, NULL, 'm'},
2045 {0, 0, 0, 0}};
2046
2047 while ((c = bb_getopt_long(argc, argv, (char *)"hsvr:p:d:c:f:g:t:n:R:m",
2048 long_options, &opt_indx)) != -1) {
2049 switch (c) {
2050 case 0:
2051 break;
2052 case 'h':
2053 cdb2sql_usage(EXIT_SUCCESS);
2054 break;
2055 case 's':
2056 scriptmode = 1;
2057 break;

Callers

nothing calls this directly

Calls 15

bb_getopt_longFunction · 0.85
cdb2sql_usageFunction · 0.85
cdb2_set_comdb2db_configFunction · 0.85
cdb2_disable_sockpoolFunction · 0.85
dbtype_validFunction · 0.85
cdb2_closeFunction · 0.85
do_repeatFunction · 0.85
freeFunction · 0.85
process_lineFunction · 0.70
load_readline_historyFunction · 0.70
sigactionClass · 0.70

Tested by

no test coverage detected