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

Function main

src/csplit.c:1281–1392  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1279}
1280
1281int
1282main (int argc, char **argv)
1283{
1284 int optc;
1285
1286 initialize_main (&argc, &argv);
1287 set_program_name (argv[0]);
1288 setlocale (LC_ALL, "");
1289 bindtextdomain (PACKAGE, LOCALEDIR);
1290 textdomain (PACKAGE);
1291
1292 atexit (close_stdout);
1293
1294 global_argv = argv;
1295
1296 while ((optc = getopt_long (argc, argv, "f:b:kn:sqz", longopts, NULL))
1297 != -1)
1298 switch (optc)
1299 {
1300 case 'f':
1301 prefix = optarg;
1302 break;
1303
1304 case 'b':
1305 suffix = optarg;
1306 break;
1307
1308 case 'k':
1309 remove_files = false;
1310 break;
1311
1312 case 'n':
1313 digits = xdectoimax (optarg, 0, MIN (INT_MAX, IDX_MAX), "",
1314 _("invalid number"), 0);
1315 break;
1316
1317 case 's':
1318 case 'q':
1319 suppress_count = true;
1320 break;
1321
1322 case 'z':
1323 elide_empty_files = true;
1324 break;
1325
1326 case SUPPRESS_MATCHED_OPTION:
1327 suppress_matched = true;
1328 break;
1329
1330 case_GETOPT_HELP_CHAR;
1331
1332 case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS);
1333
1334 default:
1335 usage (EXIT_FAILURE);
1336 }
1337
1338 if (argc - optind < 2)

Callers

nothing calls this directly

Calls 8

max_outFunction · 0.85
xalloc_dieFunction · 0.85
set_input_fileFunction · 0.85
parse_patternsFunction · 0.85
split_fileFunction · 0.85
cleanup_fatalFunction · 0.85
usageFunction · 0.70
sigactionClass · 0.70

Tested by

no test coverage detected