MCPcopy Create free account
hub / github.com/Meituan-Dianping/SQLAdvisor / parse_args

Function parse_args

extra/resolve_stack_dump.c:119–154  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

117
118
119static int parse_args(int argc, char **argv)
120{
121 int ho_error;
122
123 if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option)))
124 exit(ho_error);
125
126 /*
127 The following code is to make the command compatible with the old
128 version that required one to use the -n and -s options
129 */
130
131 if (argc == 2)
132 {
133 sym_fname= argv[0];
134 dump_fname= argv[1];
135 }
136 else if (argc == 1)
137 {
138 if (!sym_fname)
139 sym_fname = argv[0];
140 else if (!dump_fname)
141 dump_fname = argv[0];
142 else
143 {
144 usage();
145 exit(1);
146 }
147 }
148 else if (argc != 0 || !sym_fname)
149 {
150 usage();
151 exit(1);
152 }
153 return 0;
154}
155
156
157static void open_files()

Callers 1

mainFunction · 0.85

Calls 2

handle_optionsFunction · 0.85
usageFunction · 0.70

Tested by

no test coverage detected