GitHubSentinel icon indicating copy to clipboard operation
GitHubSentinel copied to clipboard

v0.2.1 命令行执行fetch命令有几个问题

Open RorschachWwww opened this issue 1 year ago • 0 comments
trafficstars

1.执行fetch langchain-ai/langchain命令会报错:main.py: error: unrecognized arguments: langchain-ai/langchain 看了一下代码发现CommandHandle.create_parser方法里,这里的代码没有给parser_fetch添加repo的argument: parser_fetch = subparsers.add_parser('fetch', help='Fetch updates immediately') parser_fetch.set_defaults(func=self.fetch_updates) 在中间加了一行:parser_fetch.add_argument('repo', type=str, help='The GitHub repository to fetch updates from')就不报这个错了。 2.改了第一条代码之后,执行还是会报错,看代码,发现CommandHandle.fetch_updates方法里 updates = self.github_client.fetch_updates()这一行没传repo参数。 改成updates = self.github_client.fetch_updates(args.repo)之后,fetch langchain-ai/langchain命令不报错了。 3.还是fetch方法,只打印了三行字符: commits issues pull_requests,没有具体内容,可能是怕打印太多故意这么写的?CommandHandle.fetch_updates方法改成如下代码就能打印github返回的内容了: def fetch_updates(self, args): updates = self.github_client.fetch_updates(args.repo) for key,value in updates.items(): print(f"{key}: {value}")

RorschachWwww avatar Oct 27 '24 04:10 RorschachWwww