good-first-issue icon indicating copy to clipboard operation
good-first-issue copied to clipboard

add more cli options

Open maddhruv opened this issue 7 years ago • 7 comments

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 avatar Nov 12 '18 16:11 maddhruv

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

maddhruv avatar Nov 14 '18 03:11 maddhruv

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 avatar Nov 25 '18 23:11 bnb

Updated the milestone to reflect the status of #40 👍

bnb avatar Dec 03 '18 00:12 bnb

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.

dopecodez avatar Dec 05 '19 07:12 dopecodez

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

bnb avatar Dec 05 '19 16:12 bnb

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 avatar Dec 05 '19 18:12 dopecodez

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.

dopecodez avatar Dec 09 '19 05:12 dopecodez