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

-in option to search from file #3

Closed
rodrigoalvesvieira opened this issue Apr 13, 2013 · 11 comments
Closed

-in option to search from file #3

rodrigoalvesvieira opened this issue Apr 13, 2013 · 11 comments

Comments

@rodrigoalvesvieira
Copy link

We must implement in the Options class the option from searching projects from the content of an informed file so that the names of the project can be passed in "bulk" rather than individually. Take this as an example:

Currently we do:

java -jar groundhog.jar -forge github -out metrics phonegap-facebook-plugin facebook-android-sdk spring-social-facebook

This will look for projects whose name match either phonegap-facebook-plugin, or facebook-android-sdk or spring-social-facebook.

But this approach can be tedious and hard to repeat as the number of projects gets larger.

So, the -in option would make our lives easier by making Groundhog read the search terms from a JSON file, like this:

this file is called projects.txt

phonegap-facebook-plugin
facebook-android-sdk
spring-social-facebook

and then:

java -jar groundhog.jar -forge github -out metrics -in projects.txt
@gustavopinto
Copy link
Member

It is an interesting feature, but, IMHO, we should first fix #9 before start this one.

@rodrigoalvesvieira
Copy link
Author

Yes, agreed. I guess we should discuss the migration to JCommander ASAP. Will talk to @fernandocastor this week and see.

@rodrigoalvesvieira
Copy link
Author

Development/debugging pro-tip for the SearchGitHub class:

log the searchUrl variable in the getProjects() method, then you can more easily grab an API url and see the content for yourself, if needed. Example (search term: github api): https://api.github.com/legacy/repos/search/github+api?start_page=1&language=java

another example (search term: cepfacil): https://api.github.com/legacy/repos/search/cepfacil?start_page=1&language=java

Screen Shot 2013-04-18 at 12 18 56 AM

@gustavopinto
Copy link
Member

And if we parse regular expressions in the project name?

Such as java -jar groundhog ... facebook* twitter*

@rodrigoalvesvieira
Copy link
Author

hmm, I don't understand :(

@gustavopinto
Copy link
Member

I mean, and if the user want to download all facebook related projects. Wouldn't it be nice if I could pass facebook* as parameter and then it download all projects that name starts with facebook?

@rodrigoalvesvieira
Copy link
Author

Ah, yeah. Got it.

@dnr2
Copy link
Member

dnr2 commented May 2, 2013

Using regular expressions to search for projects is also related to issue #19 because you could search for all projects in a repository using the regular expression '*'.

@dnr2
Copy link
Member

dnr2 commented May 7, 2013

People, I believe that it would be better if the JSON file provided all the command line arguments instead of passing only the names of the projects. @fernandocastor talked about this feature in #17, so I propose that we close this issue, that talks about passing project names through a file, and create another issue about passing all command line arguments. What do you think?

@fernandocastor
Copy link
Member

Agreed.

@dnr2
Copy link
Member

dnr2 commented May 13, 2013

As I said this issue will be replaced by #33 so I'm closing this one.

@dnr2 dnr2 closed this as completed May 13, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants