File tree Expand file tree Collapse file tree
src/main/java/com/francescodisalesdev/gitcli Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44import org .springframework .shell .standard .ShellComponent ;
55import org .springframework .shell .standard .ShellMethod ;
66import com .francescodisalesdev .gitcli .service .GitService ;
7+ import org .springframework .shell .standard .ShellOption ;
78
89import java .io .IOException ;
910import java .util .List ;
@@ -14,17 +15,18 @@ class GitCli
1415{
1516
1617 @ ShellMethod ("search for a git repository" )
17- public void query (String repository ,int page )
18+ public void query (String repository ,@ ShellOption ( defaultValue = "1" ) int page )
1819 {
1920 try
2021 {
22+
2123 GitService gitService = new GitService ();
2224 List <String > result = gitService .getResult (repository ,page );
2325
2426 if (result ==null )
2527 System .out .println ("page number must be bigger than 0" );
2628 else
27- gitService .filterPage (result );
29+ gitService .filterPage (repository , result );
2830
2931 }
3032 catch (IOException | ParseException e )
Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ public void getPages(String param) throws IOException
7575
7676 }
7777
78- public void filterPage (List <String > response )
78+ public void filterPage (String param , List <String > response ) throws IOException
7979 {
8080
8181 Iterator responseIterator = response .iterator ();
@@ -85,6 +85,9 @@ public void filterPage(List<String> response)
8585 System .out .println (responseIterator .next ());
8686 }
8787
88+ System .out .println ("total pages for this search:" );
89+ this .getPages (param );
90+
8891 }
8992
9093 public void cloneRepository (String repository ,String localPath ) throws IOException , InterruptedException
You can’t perform that action at this time.
0 commit comments