Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support --sort for register command #2180

Open
igxlin opened this issue Mar 1, 2024 · 1 comment
Open

Support --sort for register command #2180

igxlin opened this issue Mar 1, 2024 · 1 comment
Labels
A-WISH Some kind of improvement request, hare-brained proposal, or plea. register

Comments

@igxlin
Copy link

igxlin commented Mar 1, 2024

Look like currently hledger only print register in the order of date. The --sort option of ledger register is very helpful when users want to get the expenses of most amount. Hope to have that option in hledger.

--sort value-expression (-S)
                                 Sort  postings  by evaluating the given value-expression.  Note that a
                                 comma-separated list of expressions is allowed,  in  which  case  each
                                 sorting  term  is  used in order to determine the final ordering.  For
                                 example, to search by date and then amount, one would use:
                                       ledger reg --sort 'date, amount'
                                 The sort order may be controlled with the '-' sign.  For  example,  to
                                 sort in reverse chronological order:
                                       ledger reg --sort '-date'
@simonmichael simonmichael added A-WISH Some kind of improvement request, hare-brained proposal, or plea. register labels Mar 1, 2024
@reesmichael1
Copy link
Collaborator

I've started working on this, and I'm curious how many value-expressions we'd want to support. I think it might be easiest to start a draft PR with support for, say, date, account, and amount, and then add more from there as needed.

Are there any other commonly used ones that anyone thinks should be included to start?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-WISH Some kind of improvement request, hare-brained proposal, or plea. register
Projects
None yet
Development

No branches or pull requests

3 participants