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

Function main

src/stat.c:1889–1999  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1887}
1888
1889int
1890main (int argc, char *argv[])
1891{
1892 int c;
1893 bool fs = false;
1894 bool terse = false;
1895 char *format = NULL;
1896 char *format2;
1897 bool ok = true;
1898
1899 initialize_main (&argc, &argv);
1900 set_program_name (argv[0]);
1901 setlocale (LC_ALL, "");
1902 bindtextdomain (PACKAGE, LOCALEDIR);
1903 textdomain (PACKAGE);
1904
1905 struct lconv const *locale = localeconv ();
1906 decimal_point = (locale->decimal_point[0] ? locale->decimal_point : ".");
1907 decimal_point_len = strlen (decimal_point);
1908
1909 atexit (close_stdout);
1910
1911 while ((c = getopt_long (argc, argv, "c:fLt", long_options, NULL)) != -1)
1912 {
1913 switch (c)
1914 {
1915 case PRINTF_OPTION:
1916 format = optarg;
1917 interpret_backslash_escapes = true;
1918 trailing_delim = "";
1919 break;
1920
1921 case 'c':
1922 format = optarg;
1923 interpret_backslash_escapes = false;
1924 trailing_delim = "\n";
1925 break;
1926
1927 case 'L':
1928 follow_links = true;
1929 break;
1930
1931 case 'f':
1932 fs = true;
1933 break;
1934
1935 case 't':
1936 terse = true;
1937 break;
1938
1939 case 0:
1940 switch (XARGMATCH ("--cached", optarg, cached_args, cached_modes))
1941 {
1942 case cached_never:
1943 force_sync = true;
1944 dont_sync = false;
1945 break;
1946 case cached_always:

Callers

nothing calls this directly

Calls 5

default_formatFunction · 0.85
do_statfsFunction · 0.85
usageFunction · 0.70
getenv_quoting_styleFunction · 0.70
do_statFunction · 0.70

Tested by

no test coverage detected