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

Function main

src/join.c:1028–1229  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1026}
1027
1028int
1029main (int argc, char **argv)
1030{
1031 int optc_status;
1032 int prev_optc_status = MUST_BE_OPERAND;
1033 int operand_status[2];
1034 int joption_count[2] = { 0, 0 };
1035 FILE *fp1, *fp2;
1036 int optc;
1037 int nfiles = 0;
1038
1039 initialize_main (&argc, &argv);
1040 set_program_name (argv[0]);
1041 setlocale (LC_ALL, "");
1042 bindtextdomain (PACKAGE, LOCALEDIR);
1043 textdomain (PACKAGE);
1044 hard_LC_COLLATE = hard_locale (LC_COLLATE);
1045
1046 atexit (close_stdout);
1047 atexit (free_spareline);
1048
1049 while ((optc = getopt_long (argc, argv, "-a:e:i1:2:j:o:t:v:z",
1050 longopts, NULL))
1051 != -1)
1052 {
1053 optc_status = MUST_BE_OPERAND;
1054
1055 switch (optc)
1056 {
1057 case 'v':
1058 print_pairables = false;
1059 FALLTHROUGH;
1060
1061 case 'a':
1062 {
1063 long int val;
1064 if (xstrtol (optarg, NULL, 10, &val, "") != LONGINT_OK
1065 || (val != 1 && val != 2))
1066 error (EXIT_FAILURE, 0,
1067 _("invalid file number: %s"), quote (optarg));
1068 if (val == 1)
1069 print_unpairables_1 = true;
1070 else
1071 print_unpairables_2 = true;
1072 }
1073 break;
1074
1075 case 'e':
1076 if (empty_filler && ! streq (empty_filler, optarg))
1077 error (EXIT_FAILURE, 0,
1078 _("conflicting empty-field replacement strings"));
1079 empty_filler = optarg;
1080 break;
1081
1082 case 'i':
1083 ignore_case = true;
1084 break;
1085

Callers

nothing calls this directly

Calls 6

set_join_fieldFunction · 0.85
string_to_join_fieldFunction · 0.85
add_field_listFunction · 0.85
add_file_nameFunction · 0.85
joinFunction · 0.85
usageFunction · 0.70

Tested by

no test coverage detected