make -k quit after printing the key list

This commit is contained in:
silverweed 2025-02-04 15:56:59 +01:00
parent 77526b65f9
commit c65e43af1a
3 changed files with 6 additions and 1 deletions

View file

@ -9,7 +9,7 @@ void print_help(const char *argv0)
"\n\t-e: display some extended info(*) (may slow down the startup)"
"\n\t-h: display this help and exit"
"\n\t-l: display LEN bytes (only in terminal mode)"
"\n\t-k: print information about the TKeys in the file"
"\n\t-k: print information about the TKeys in the file and exit"
"\n\t-n: list the names of the RNTuples found in the file and exit"
"\n\t-s: set first displayed byte to START"
"\n\t-t: no graphics, output to terminal"

View file

@ -176,6 +176,8 @@ int main(int argc, char **argv)
}
return 0;
}
if (args.print_keys_info)
return 0;
if (success)
app.fdata.rndata = get_rntuple_data(app.fdata.arena, app.inspected_file, app.fdata.tfile_data, args.extended_info);

View file

@ -219,6 +219,9 @@ b8 walk_tkeys(Arena *arena, const u8 *data, u64 data_len, u32 flags, TFile_Data
}
if (is_free_slot) {
if (flags & WTK_PRINT_KEYS_INFO) {
printf("Free Slot at 0x%lX, len: %d (%s)\n", cur, n_bytes, to_pretty_size(scratch.arena, n_bytes).c());
}
// don't try to read the rest of the data
cur += n_bytes;
continue;