Skip to content

Sort By Key - #13

Open
karthage-spartacus wants to merge 5 commits into
kesla:masterfrom
karthage-spartacus:master
Open

Sort By Key#13
karthage-spartacus wants to merge 5 commits into
kesla:masterfrom
karthage-spartacus:master

Conversation

@karthage-spartacus

Copy link
Copy Markdown

Added the possibility to choose a key for sorting with the flag "-k [key]" or "--key [key]"

@kesla

kesla commented Sep 7, 2017

Copy link
Copy Markdown
Owner

Hey!

Thanks for the pull request.

I have to admit that I'm having troubles understanding exactly what this PR does... Could you perhaps post some example input/out when using the "key"option? Or perhaps even better, add some tests :)

@kesla

kesla commented Sep 7, 2017

Copy link
Copy Markdown
Owner

Also, if you could rebase on latest master so we can get travis working in this PR that'll be great!

@karthage-spartacus

Copy link
Copy Markdown
Author

Hi ! well It wasn't very clear indeed...
This PR enables you to choose the key to sort a JSON array. I had an issue with a JSON array which had multiple keys (id int, title string, etc.) and when I used sort-JSON on it, it was sorted by title but I wanted it sorted by id. So I made it up :) . I'll rebase the PR and i'll add some tests in a few days :)

@kingthorin

Copy link
Copy Markdown

Is this still coming? It's be nice to see, I have a use case where it'd be helpful.

@karthage-spartacus

Copy link
Copy Markdown
Author

@kingthorin I'll try to push a new PR this weekend if I have the time :)

@hbhaq

hbhaq commented Feb 7, 2020

Copy link
Copy Markdown

Would be great if you can do it this weekend! i require the same functionality for something im working on!

@kingthorin

Copy link
Copy Markdown

Any news?

@kingthorin

Copy link
Copy Markdown

Ping 😊

@karthage-spartacus

Copy link
Copy Markdown
Author

@kingthorin sorry for the late feedback, I just made a new PR here: #39

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

Successfully merging this pull request may close these issues.

4 participants