CBOR2COMMENT(1)

πŸ“¦
version 8.1.0 Β· 3 versions
, in ubuntu noble, ubuntu resolute

okay so bestie, pull up a chair 🫢 this is cbor2comment(1), the manual page for the lil tool that takes CBOR wire protocol and gives you back a commented version of it. it's giving ✨annotated hex✨ and we're gonna go through every single line together, no cap.


πŸŽ€ NAME πŸŽ€

cbor2comment β€” convert CBOR wire protocol to commented version πŸ’–


🌸 SYNOPSIS 🌸

  cbor2comment test.cbor > test.txt

that's it. that's the whole vibe. feed it a file, redirect the glow-up into a text file. periodt. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so like, cbor2comment creates a commented version of an input bytestream. not a decoder, not a pretty-printer that hides stuff β€” a commentary track for your bytes. 🎬

for example, if the input contained the two bytes (in hex) 61 61, the output would be:

     61                -- String, length: 1
       61              -- "a"
   0x6161

see how it eats?? 😭 every byte gets its own little annotation, and then the summary hex line sits right there at the bottom like the credits. 61 says "String, length: 1", the nested 61 says "a", and 0x6161 is the whole thing in one glance. iconic. πŸ‘‘


✨ OPTIONS ✨

  • - β€” read from stdin instead of a file. this is the default, so if you just pipe stuff in, you're already doing it right. 🫢
  • -t NUM, --tabsize NUM β€” the number of 2-space tab indents to move the -- to the right. so like, it's how far over your comments hang. lowkey a vibe knob. eventually, this will be replaced with an algorithm that takes two passes over the input. πŸ‘€
  • -x [string] β€” read the input from the hex-encoded string on the command line. no file needed, just yeet the hex straight at it. πŸ”₯
  • -V, --version β€” print the node-cbor version and exit. short and sweet. πŸ’œ
  • -h, --help β€” print some help text and exit. your friendly lil escape hatch. 🌈

πŸ’€ TODO πŸ’€

aka the "not me writing a list of my own homework" section, and honestly? relatable.

  • cbor2comment is not built for execution speed or reuse. πŸ™ˆ it does the thing! it's just not racing anybody.
  • Make 2 passes over the input. (this is the same two-pass dream the -t flag is waiting on, iykyk. 🧚)
  • Move the summary hex output to the beginning. right now it's at the end, and it's gonna get relocated to the front. glow-up pending. ⭐

🌟 SEE ALSO 🌟


and that's the whole page!! πŸ’– this one's from November 2022, living in section 1 as CBOR2COMMENT(1), and brought to you by the node-cbor crew (yes, the same version that -V will happily print for you 🫢). go comment some bytes, you're gonna slay. πŸ’…βœ¨

πŸ“¦ where this page comes from