sorttrans-cli(1)

πŸ’– sorttrans-cli β€” the manual, but make it make sense πŸ’–

okay bestie, so sorttrans-cli lives in section 1 of the General Commands Manual, and it does exactly one iconic thing: it sorts a ledger file in chronological order. that's it. that's the whole vibe. ✨


🌸 NAME 🌸

sorttrans-cli β€” sorts a ledger file in chronological order πŸ—‚οΈβœ¨


πŸ¦‹ SYNOPSIS πŸ¦‹

sorttrans-cli [options]

no positional args, no drama. it's all flags, babes. πŸ’…


πŸ’œ OPTIONS πŸ’œ

  • -y β€” write the file back immediately, no diff, no preview, no "wait let me look at it first". just yeet and go. 😭
  • -h, --help β€” show the help message and dip out. classic. 🫢
  • --file FILE β€” tell it the path to the ledger file you wanna work with. πŸ“
  • --price-db PRICEDB β€” tell it the path to the ledger price database you wanna work with. πŸ’°
  • --debug β€” turns on debugging output. may be useful for developers πŸ‘€ (iykyk, if you're not a dev you probably don't need this one)

✨ DESCRIPTION ✨

so sorttrans-cli is a text program, right? and its whole personality is sorting a ledger into chronological order. chronological, as in, time order. the timeline. the correct order. ⏳

here's the tea on how it works: the program loads the ledger file and sorts the transactions in memory. 🧠 then, depending on which command-line options you gave it, it does one of two things:

  • it either writes the sorted file back πŸ“
  • or it invokes meld with the original and the sorted version shown side by side, so you can do interactive editing like the little editor gremlin you are πŸ‘‘πŸ–₯️
now listen carefully, bestie, because this part is not optional: the program must be supplied with the location of the ledger file to work with. no file, no sorting. periodt.

if you didn't hand it over with the command-line option --file, then the location of the file gets determined using the following mechanisms, in this order. the first mechanism which yields a result wins. πŸ† (yes, first one to show up takes the crown, the rest don't even get a turn)


🌈 ENVIRONMENT 🌈

the following environment variable is recognized by this program:

  • LEDGER_FILE β€” path to ledger file to work with. 🌱

πŸŽ€ FILES πŸŽ€

the config file for ledger(1) β€” namely the file .ledgerrc in the user's home directory 🏠 β€” is scanned, looking for the following option:

  • --file FILE β€” path to ledger file to work with. πŸ“‚

πŸ”₯ SEE ALSO πŸ”₯

ledger(1), meld(1), addtrans(1), cleartrans-cli(1), sellstock-cli(1), withdraw-cli(1). πŸ’«


and that's the whole page, babe β€” this one's from the General Commands Manual, sorttrans-cli(1), dated November 14 2022. go forth and sort chronologically, you absolute main character. πŸ’…πŸ’–πŸ¦‹

πŸ“¦ where this page comes from