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

"sort" command #3

Open
lemon24 opened this issue Jul 4, 2023 · 0 comments
Open

"sort" command #3

lemon24 opened this issue Jul 4, 2023 · 0 comments

Comments

@lemon24
Copy link
Owner

lemon24 commented Jul 4, 2023

In-memory fine, initially.

Sort key regex (named, first group, whole match; like --section marker). Maybe multiple groups too?

Would be nice to have natural/human sort (see Unix sort flags).


Update:

Relevant Unix sort flags:

  • -n, --numeric-sort
  • -h, --human-numeric-sort (can be added later)
  • -r, --reverse
  • -k, --key=POS1[,POS2], "POS is F[.C][OPTS], where F is the field number and C the character position in the field"
  • -t, --field-separator=SEP (arguably, both this and --key should work like linesieve split)

It should also be possible to pass a regex key:

  • no groups: full match
  • numeric groups: ???
  • named groups: custom order, with flags like --key OPTS (a la linesieve parse name__value feature)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant