-
-
Notifications
You must be signed in to change notification settings - Fork 334
feat: register: add --sort as in ledger #2211
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @reesmichael1 ! Some comments added.
Looking good! Now that I've played with it a bit more - I think people will want More ideas, though not blockers:
|
I didn't test this, but I wondered: does a |
Thanks! I actually started adding it to I'll add in the I'll verify again, but I'm pretty sure the |
Ok, I think I've hacked together a way to get |
I'd hoped to get |
As part of this migration, I also switched from using Data.List.splitOn to Hledger.Utils.splitAtElement.
If there is no sort spec given, then the postings are already sorted by date, so there's no need to apply the default sort spec again.
Thanks @reesmichael1. I'd be ok with merging this now but there's one niggling change needed I think: also mention the allowed --sort keywords in 1. the option's help and 2. the error message when a bad value is given (and ideally also when no value is given, but I suspect that's too hard). No hurry on this, vacation++ 🏝️ |
PS: I rebased. |
I have merged this to catch the next release. Thanks a lot @reesmichael1! If/when you work on it again (for aregister), this is still worth considering:
|
Thanks for taking over for me! Sorry for disappearing, I have been swamped with life over the last several weeks. I'll try to get back to continuing this soon! |
This begins work towards implementing the
--sort
argument forregister
, as requested in #2180. This still needs some polishing (e.g., documentation), but I wanted to get this up to discuss the implementation. The biggest question to me is ifSortSpec
is better placed inReportOptions
, which would let it be reused across the other reports along with justregister
(at the very least, it seems like this should be reused acrossaregister
).Moving it would also let us calculate it internally in
postingsReport
instead of awkwardly passing in aMaybe SortSpec
whereverpostingsReport
is called.