ljharb / repo-report

CLI to list all repos a user has access to, and report on their configuration in aggregate.
MIT License
24 stars 11 forks source link

Feature sorting #17

Closed diananova closed 3 years ago

diananova commented 3 years ago

image

thehanimo commented 3 years ago

Ready for merge.

diananova commented 3 years ago

So I tried implementing the sort=slug command in the most intuitive way (by adding another flag), but as @sladyn98 mentioned it doesn't look very good. I assume we will have more flags in the future, and the max number of parameters for the async function generateTable should be 3.

I also thought that maybe we can let the user sort by any field they want? Of course, we also have the group by but it doesn't offer the same functionality. This way, list -s foo would sort by foo (checking first if foo is a valid field). So we would have list -s name, list -s slug, list -s wiki etc..

sladyn98 commented 3 years ago

So I tried implementing the sort=slug command in the most intuitive way (by adding another flag), but as @sladyn98 mentioned it doesn't look very good. I assume we will have more flags in the future, and the max number of parameters for the async function generateTable should be 3.

I also thought that maybe we can let the user sort by any field they want? Of course, we also have the group by but it doesn't offer the same functionality. This way, list -s foo would sort by foo (checking first if foo is a valid field). So we would have list -s name, list -s slug, list -s wiki etc..

For the mvp we could just resort to a default sorting instead of complicating it. Maybe just let the sorting do what it does right now and open an issue for extending it later on. What do you guys think ?

diananova commented 3 years ago

@sladyn98 yeah sounds good to me