MCPcopy Create free account
hub / github.com/coreutils/coreutils / main

Function main

src/expand.c:188–245  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

186}
187
188int
189main (int argc, char **argv)
190{
191 int c;
192
193 initialize_main (&argc, &argv);
194 set_program_name (argv[0]);
195 setlocale (LC_ALL, "");
196 bindtextdomain (PACKAGE, LOCALEDIR);
197 textdomain (PACKAGE);
198
199 atexit (close_stdout);
200 convert_entire_line = true;
201
202 while ((c = getopt_long (argc, argv, shortopts, longopts, NULL)) != -1)
203 {
204 switch (c)
205 {
206 case 'i':
207 convert_entire_line = false;
208 break;
209
210 case 't':
211 parse_tab_stops (optarg);
212 break;
213
214 case '0': case '1': case '2': case '3': case '4':
215 case '5': case '6': case '7': case '8': case '9':
216 if (optarg)
217 parse_tab_stops (optarg - 1);
218 else
219 {
220 char tab_stop[2];
221 tab_stop[0] = c;
222 tab_stop[1] = '\0';
223 parse_tab_stops (tab_stop);
224 }
225 break;
226
227 case_GETOPT_HELP_CHAR;
228
229 case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS);
230
231 default:
232 usage (EXIT_FAILURE);
233 }
234 }
235
236 finalize_tab_stops ();
237
238 set_file_list (optind < argc ? &argv[optind] : NULL);
239
240 expand ();
241
242 cleanup_file_list_stdin ();
243
244 return exit_status;
245}

Callers

nothing calls this directly

Calls 6

parse_tab_stopsFunction · 0.85
finalize_tab_stopsFunction · 0.85
set_file_listFunction · 0.85
expandFunction · 0.85
cleanup_file_list_stdinFunction · 0.85
usageFunction · 0.70

Tested by

no test coverage detected