MTBL_DUMP(1)

πŸ“¦
version 1.6.1 Β· 2 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

mtbl_dump β€” bestie, this one prints the key-value entries out of an MTBL file. That's it, that's the job. πŸŽ€


✨ SYNOPSIS ✨

mtbl_dump [-s] [-x] [-k ABCD] [-v ABCD] [-K #] [-V #] FILE

🌸 DESCRIPTION 🌸

Okay so mtbl_dump(1) prints all the key-value entries from an MTBL file straight to stdout, in file order. No sorting, no drama, just vibes in the order the file gave them to us. πŸ’…

By default, every entry gets its own line, with double quotes wrapping the key and the value, and a single space character chillin' between the two. Unprintable characters and embedded double quote characters get escaped using the Python string literal syntax. Iconic behaviour, honestly. 🐍✨


πŸ”₯ The -x hex mode glow-up

With the -x option, each entry is printed on its own line, formatted as an 8 digit hex length, then a colon, then the hex digit pairs separated by a dash β€” and you get that whole treatment for the key and for the value. Look at these little masterpieces:

0000006:00-02-61-63-08-64 00000003:f2-e9-e4
00000004:03-01-2d-00 00000000:

πŸ¦‹ Prefix matching, aka the -k and -v era

The -k and -v options take as arguments a prefix as a hex-string with no embedded punctuation. So for example, -k "00ab" is legal, but -v "00-ab" is illegal. Not me enforcing the rules but okay periodt. πŸ’€

  • With the -k option, only entries whose key matches the prefix will be printed.
  • With the -v option, only entries whose value matches the prefix will be printed.

πŸ‘‘ Length matching, aka -K and -V

The -K and -V options take as arguments a positive integer which specifies the minimum length of the key or value, respectfully. (That's the original's wording, bestie, I'm not touching it 🫢)


🌈 Stacking filters

-k, -v, -K, and -V can all be specified at the same time, and only entries that match all of them will be printed. Every filter has to say yes. It's giving group chat consensus. πŸ˜­βœ…


πŸ’œ OPTIONS πŸ’œ

  • -s β€” Silent mode (don't output anything). Lowkey useful for benchmarking, highkey the chillest flag here. 🀫
  • -x β€” Use hex mode output, described above. The hex-y one. πŸ”₯
  • -k β€” Match on a key prefix, described above. πŸ”‘
  • -v β€” Match on a value prefix, described above. πŸ“¦
  • -K β€” Match on a key prefix by minimal length, described above. πŸ“
  • -V β€” Match on a value prefix by minimal length, described above. πŸ“
Heads up bestie: -k and -v want hex-strings with no punctuation, and -K and -V want positive integers. Don't mix those up or it's not gonna go how you want. πŸ’…

and that's the whole page, no notes, ate and left no crumbs πŸ’–βœ¨πŸ¦‹

This lil' slice of the mtbl_dump(1) manual is dated 07/13/2021, and it's the mtbl_dump page itself living in the manual β€” so yeah, that's the source and the version, and I said it cute because you deserve it. πŸŽ€πŸ‘‘

πŸ“¦ where this page comes from