~martin-decky/helenos/rcu

« back to all changes in this revision

Viewing changes to uspace/app/blkdump/blkdump.c

  • Committer: Martin Sucha
  • Date: 2011-02-12 14:52:17 UTC
  • mto: (720.2.80 ext2-merge)
  • mto: This revision was merged to the branch mainline in revision 1004.
  • Revision ID: sucha14@st.fmph.uniba.sk-20110212145217-ztv3twst4twejox1
Add --relative option for blkdump also to help string

Show diffs side-by-side

added added

removed removed

Lines of Context:
68
68
        size_t data_offset;
69
69
        aoff64_t current;
70
70
        aoff64_t limit;
 
71
        bool relative = false;
71
72
        
72
73
        if (argc < 2) {
73
74
                printf(NAME ": Error, argument missing.\n");
77
78
 
78
79
        --argc; ++argv;
79
80
 
 
81
        if (str_cmp(*argv, "--relative") == 0) {
 
82
                --argc; ++argv;
 
83
                relative = true;
 
84
        }
 
85
        
80
86
        if (str_cmp(*argv, "--offset") == 0) {
81
87
                --argc; ++argv;
82
88
                if (*argv == NULL) {
165
171
                printf("---- Block %" PRIuOFF64 " (at %" PRIuOFF64 ") ----\n", current, current*block_size);
166
172
                
167
173
                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
                        }
169
180
                        print_hex_row(data+data_offset, block_size-data_offset, 16);
170
181
                        printf("\n");
171
182
                }
223
234
 
224
235
static void syntax_print(void)
225
236
{
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");
227
238
}
228
239
 
229
240
/**