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

Function main

src/unexpand.c:272–342  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

270}
271
272int
273main (int argc, char **argv)
274{
275 bool have_tabval = false;
276 colno tabval IF_LINT ( = 0);
277 int c;
278
279 /* If true, cancel the effect of any -a (explicit or implicit in -t),
280 so that only leading blanks will be considered. */
281 bool convert_first_only = false;
282
283 initialize_main (&argc, &argv);
284 set_program_name (argv[0]);
285 setlocale (LC_ALL, "");
286 bindtextdomain (PACKAGE, LOCALEDIR);
287 textdomain (PACKAGE);
288
289 atexit (close_stdout);
290
291 while ((c = getopt_long (argc, argv, ",0123456789at:", longopts, NULL))
292 != -1)
293 {
294 switch (c)
295 {
296 case '?':
297 usage (EXIT_FAILURE);
298 case 'a':
299 convert_entire_line = true;
300 break;
301 case 't':
302 convert_entire_line = true;
303 parse_tab_stops (optarg);
304 break;
305 case CONVERT_FIRST_ONLY_OPTION:
306 convert_first_only = true;
307 break;
308 case ',':
309 if (have_tabval)
310 add_tab_stop (tabval);
311 have_tabval = false;
312 break;
313 case_GETOPT_HELP_CHAR;
314 case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS);
315 default:
316 if (!have_tabval)
317 {
318 tabval = 0;
319 have_tabval = true;
320 }
321 if (!DECIMAL_DIGIT_ACCUMULATE (tabval, c - '0'))
322 error (EXIT_FAILURE, 0, _("tab stop value is too large"));
323 break;
324 }
325 }
326
327 if (convert_first_only)
328 convert_entire_line = false;
329

Callers

nothing calls this directly

Calls 7

parse_tab_stopsFunction · 0.85
add_tab_stopFunction · 0.85
finalize_tab_stopsFunction · 0.85
set_file_listFunction · 0.85
unexpandFunction · 0.85
cleanup_file_list_stdinFunction · 0.85
usageFunction · 0.70

Tested by

no test coverage detected