cutenode / good-first-issue

🖥 CLI for finding good first issues
736 stars 123 forks source link

add more cli options #13

Open maddhruv opened 5 years ago

maddhruv commented 5 years ago

we've set sort and order already in the module rather we can provide options to the cli+module

suggested options -

Option type default description
first boolean false return the first/top result
order enum [asc, desc] asc
sort enum[comments, created, updated] updated
open boolean false open the issue in browser
maddhruv commented 5 years ago

first and open are done in #16 will do others in a different one have to make changes to the module

bnb commented 5 years ago

Since I've changed https://github.com/bnb/good-first-issue/pull/40 to 0.16.0, I'm also going to change this to 0.16.0 👍

bnb commented 5 years ago

Updated the milestone to reflect the status of #40 👍

dopecodez commented 4 years ago

I am thinking about taking this issue up. Adding sort and order shouldn't be too difficult. But i would think the best option would be to add them as string inputs. We can keep a array in a constants file in the code to list the valid options. I also think that adding a --help flag to the cli to list all the options(including --open, --first as well as available options for --sort and --order) should be taken up as well to make the working sensible.

Another option would be allow -s and -o as booleans and using inquirer to prompt the user to select from a list of valid options, although this beats the purpose of a cli app. I would go for the first approach while validating the inputs and showing valid options in case user inputs a error.

Would be great if anyone is still watching this issue to advice on what path to take. Also, should i cut a new feature branch on master to implement said features?

Edit: i was on the testing branch when i made this comment. On checking out to master, i realise that the octokit rest feature has now been shipped as a module. Any changes made in the code is meaningless without changing the code in libgfi. We should ideally create an issue on libgfi and make the necessary changes there as well.

bnb commented 4 years ago

@dopecodez feel free to create an issue/PR in libgfi! :)

dopecodez commented 4 years ago

Thanks for the reply @bnb . You can expect an issue on libgfi by tomorrow and a PR shortly after. It makes sense to fix the module before taking this issue up. Once we get libgfi up to run with sort and order, we can work on this repo and add the above said options here!

dopecodez commented 4 years ago

Hey @bnb , just wanted to give you a heads up that i opened up a PR in libgfi a couple of days back. It'd be great if you can have a look at it when you get the time.