Changeset 523a4b6 in mainline


Ignore:
Timestamp:
2013-09-04T07:46:02Z (11 years ago)
Author:
Manuele Conti <conti.ma@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
9dbdda9
Parents:
8ca4b1ab
Message:

Add u option in df application to print usage.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/df/df.c

    r8ca4b1ab r523a4b6  
    7575        /*   Parse command line options...        */
    7676        /******************************************/
    77         while ((optres = getopt(argc, argv, ":hb:")) != -1) {
     77        while ((optres = getopt(argc, argv, ":uhb:")) != -1) {
    7878                switch(optres) {
     79                case 'u':
     80                        print_usage();
     81                        return 0;
     82
    7983                case 'h':
    8084                        human_readable = 1;
     
    159163                char tmp[1024];
    160164                size_to_human_readable(tmp, st->f_blocks *  st->f_bsize);
    161                 printf(" %14s", tmp);                                                                 /* Size       */
     165                printf(" %14s", tmp);                                                                  /* Size       */
    162166                size_to_human_readable(tmp, (st->f_blocks - st->f_bfree)  *  st->f_bsize);
    163                 printf(" %14s", tmp);                                                                 /* Used       */
     167                printf(" %14s", tmp);                                                                  /* Used       */
    164168                size_to_human_readable(tmp, st->f_bfree *  st->f_bsize);
    165                 printf(" %14s", tmp);                                                                 /* Available  */
     169                printf(" %14s", tmp);                                                                  /* Available  */
    166170                printf(" %4llu%% %s\n",
    167171                        (st->f_blocks)?PERCENTAGE(st->f_blocks - st->f_bfree, st->f_blocks):0L,        /* Used%      */
     
    183187{
    184188  printf("syntax: %s [-h] [-i]\n", NAME);
     189  printf("  u : Print usage.\n"); 
    185190  printf("  h : \"Human-readable\" output.\n"); 
    186191  printf("  b : Scale block sizes by selected size.\n"); 
Note: See TracChangeset for help on using the changeset viewer.