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

Function main

src/df.c:1589–1847  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1587}
1588
1589int
1590main (int argc, char **argv)
1591{
1592 struct stat *stats = NULL;
1593
1594 initialize_main (&argc, &argv);
1595 set_program_name (argv[0]);
1596 setlocale (LC_ALL, "");
1597 bindtextdomain (PACKAGE, LOCALEDIR);
1598 textdomain (PACKAGE);
1599
1600 atexit (close_stdout);
1601
1602 /* If true, use the POSIX output format. */
1603 bool posix_format = false;
1604
1605 char const *msg_mut_excl = _("options %s and %s are mutually exclusive");
1606
1607 while (true)
1608 {
1609 int oi = -1;
1610 int c = getopt_long (argc, argv, "aB:iF:hHklmPTt:vx:", long_options,
1611 &oi);
1612 if (c == -1)
1613 break;
1614
1615 switch (c)
1616 {
1617 case 'a':
1618 show_all_fs = true;
1619 break;
1620 case 'B':
1621 {
1622 enum strtol_error e = human_options (optarg, &human_output_opts,
1623 &output_block_size);
1624 if (e != LONGINT_OK)
1625 xstrtol_fatal (e, oi, c, long_options, optarg);
1626 }
1627 break;
1628 case 'i':
1629 if (header_mode == OUTPUT_MODE)
1630 {
1631 error (0, 0, msg_mut_excl, "-i", "--output");
1632 usage (EXIT_FAILURE);
1633 }
1634 header_mode = INODES_MODE;
1635 break;
1636 case 'h':
1637 human_output_opts = human_autoscale | human_SI | human_base_1024;
1638 output_block_size = 1;
1639 break;
1640 case 'H':
1641 human_output_opts = human_autoscale | human_SI;
1642 output_block_size = 1;
1643 break;
1644 case 'k':
1645 human_output_opts = 0;
1646 output_block_size = 1024;

Callers

nothing calls this directly

Calls 11

add_fs_typeFunction · 0.85
add_excluded_fs_typeFunction · 0.85
decode_output_argFunction · 0.85
automount_stat_errFunction · 0.85
get_field_listFunction · 0.85
get_headerFunction · 0.85
get_entryFunction · 0.85
get_all_entriesFunction · 0.85
get_devFunction · 0.85
print_tableFunction · 0.85
usageFunction · 0.70

Tested by

no test coverage detected