Changeset d3842e0 in mainline


Ignore:
Timestamp:
2011-02-12T14:52:17Z (13 years ago)
Author:
Martin Sucha <sucha14@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
d5e2763
Parents:
cd5816d6
Message:

Add —relative option for blkdump also to help string

File:
1 edited

Legend:

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

    rcd5816d6 rd3842e0  
    6969        aoff64_t current;
    7070        aoff64_t limit;
     71        bool relative = false;
    7172       
    7273        if (argc < 2) {
     
    7879        --argc; ++argv;
    7980
     81        if (str_cmp(*argv, "--relative") == 0) {
     82                --argc; ++argv;
     83                relative = true;
     84        }
     85       
    8086        if (str_cmp(*argv, "--offset") == 0) {
    8187                --argc; ++argv;
     
    166172               
    167173                for (data_offset = 0; data_offset < block_size; data_offset += 16) {
    168                         printf("%8" PRIxOFF64 ": ", current*block_size + data_offset);
     174                        if (relative) {
     175                                printf("%8" PRIxOFF64 ": ", (aoff64_t) data_offset);
     176                        }
     177                        else {
     178                                printf("%8" PRIxOFF64 ": ", current*block_size + data_offset);
     179                        }
    169180                        print_hex_row(data+data_offset, block_size-data_offset, 16);
    170181                        printf("\n");
     
    224235static void syntax_print(void)
    225236{
    226         printf("syntax: blkdump [--offset <num_blocks>] [--count <num_blocks>] <device_name>\n");
     237        printf("syntax: blkdump [--relative] [--offset <num_blocks>] [--count <num_blocks>] <device_name>\n");
    227238}
    228239
Note: See TracChangeset for help on using the changeset viewer.