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

Function main

src/ptx.c:1788–2045  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1786};
1787
1788int
1789main (int argc, char **argv)
1790{
1791 int optchar; /* argument character */
1792 int file_index; /* index in text input file arrays */
1793
1794 /* Decode program options. */
1795
1796 initialize_main (&argc, &argv);
1797 set_program_name (argv[0]);
1798 setlocale (LC_ALL, "");
1799 bindtextdomain (PACKAGE, LOCALEDIR);
1800 textdomain (PACKAGE);
1801
1802 atexit (close_stdout);
1803
1804 while (optchar = getopt_long (argc, argv, "AF:GM:ORS:TW:b:i:fg:o:trw:",
1805 long_options, NULL),
1806 optchar != EOF)
1807 {
1808 switch (optchar)
1809 {
1810 default:
1811 usage (EXIT_FAILURE);
1812
1813 case 'G':
1814 gnu_extensions = false;
1815 break;
1816
1817 case 'b':
1818 break_file = optarg;
1819 break;
1820
1821 case 'f':
1822 ignore_case = true;
1823 break;
1824
1825 case 'g':
1826 {
1827 intmax_t tmp;
1828 if (! (xstrtoimax (optarg, NULL, 0, &tmp, "") == LONGINT_OK
1829 && 0 < tmp && tmp <= IDX_MAX))
1830 error (EXIT_FAILURE, 0, _("invalid gap width: %s"),
1831 quote (optarg));
1832 gap_size = tmp;
1833 break;
1834 }
1835
1836 case 'i':
1837 ignore_file = optarg;
1838 break;
1839
1840 case 'o':
1841 only_file = optarg;
1842 break;
1843
1844 case 'r':
1845 input_reference = true;

Callers

nothing calls this directly

Calls 10

unescape_stringFunction · 0.85
initialize_regexFunction · 0.85
digest_break_fileFunction · 0.85
digest_word_fileFunction · 0.85
swallow_file_in_memoryFunction · 0.85
find_occurs_in_textFunction · 0.85
sort_found_occursFunction · 0.85
fix_output_parametersFunction · 0.85
generate_all_outputFunction · 0.85
usageFunction · 0.70

Tested by

no test coverage detected