MCPcopy Create free account
hub / github.com/MariaDB/server / parse_args

Function parse_args

extra/resolve_stack_dump.c:126–161  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

mainFunction · 0.70

Calls 3

handle_optionsFunction · 0.85
local_exitFunction · 0.85
usageFunction · 0.70

Tested by

no test coverage detected