File tree Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change 1
1
import logging
2
+ import sys
2
3
3
4
logging .basicConfig (
4
5
level = logging .INFO , format = "%(asctime)s - %(levelname)s - %(message)s"
@@ -29,9 +30,30 @@ def github_collect_repo():
29
30
def hellogithub_collect_repo ():
30
31
from controllers .hellogithub_ctl import HelloGitHubController
31
32
33
+
32
34
ctl = HelloGitHubController ()
33
35
ctl .collect_repo (max_pages = 1000 )
34
36
35
37
36
38
if __name__ == "__main__" :
37
- hellogithub_collect_repo ()
39
+
40
+ funcs = {
41
+ "hellogithub_collect_repo" : hellogithub_collect_repo ,
42
+ "gitstar_collect_repo" : gitstar_collect_repo ,
43
+ "gitstar_collect_user" : gitstar_collect_user ,
44
+ "github_collect_repo" : github_collect_repo ,
45
+ }
46
+
47
+ if len (sys .argv ) < 2 :
48
+ print ("Usage: python main.py <function_name>" )
49
+ print ("Available functions:" , ", " .join (funcs .keys ()))
50
+ sys .exit (1 )
51
+
52
+ func_name = sys .argv [1 ]
53
+ func = funcs .get (func_name )
54
+ if func is None :
55
+ print (f"Unknown function: { func_name } " )
56
+ print ("Available functions:" , ", " .join (funcs .keys ()))
57
+ sys .exit (1 )
58
+
59
+ func ()
You can’t perform that action at this time.
0 commit comments