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

Function main

src/du.c:772–1193  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

770}
771
772int
773main (int argc, char **argv)
774{
775 char *cwd_only[2];
776 bool max_depth_specified = false;
777 bool ok = true;
778 char *files_from = NULL;
779
780 /* Bit flags that control how fts works. */
781 int bit_flags = FTS_NOSTAT;
782
783 /* Select one of the three FTS_ options that control if/when
784 to follow a symlink. */
785 int symlink_deref_bits = FTS_PHYSICAL;
786
787 /* If true, display only a total for each argument. */
788 bool opt_summarize_only = false;
789
790 cwd_only[0] = bad_cast (".");
791 cwd_only[1] = NULL;
792
793 initialize_main (&argc, &argv);
794 set_program_name (argv[0]);
795 setlocale (LC_ALL, "");
796 bindtextdomain (PACKAGE, LOCALEDIR);
797 textdomain (PACKAGE);
798
799 atexit (close_stdout);
800
801 exclude = new_exclude ();
802
803 human_options (getenv ("DU_BLOCK_SIZE"),
804 &human_output_opts, &output_block_size);
805
806 while (true)
807 {
808 int oi = -1;
809 int c = getopt_long (argc, argv, "0aAbd:chHklmst:xB:DLPSX:",
810 long_options, &oi);
811 if (c == -1)
812 break;
813
814 switch (c)
815 {
816#if GNULIB_FTS_DEBUG
817 case FTS_DEBUG:
818 fts_debug = true;
819 break;
820#endif
821
822 case '0':
823 opt_nul_terminate_output = true;
824 break;
825
826 case 'a':
827 opt_all = true;
828 break;
829

Callers

nothing calls this directly

Calls 6

bad_castFunction · 0.85
x_timestyle_matchFunction · 0.85
xalloc_dieFunction · 0.85
du_filesFunction · 0.85
print_sizeFunction · 0.85
usageFunction · 0.70

Tested by

no test coverage detected