在VCS中搜索文件
Repo-Scout的Python项目详细描述
repo scout在VCS中搜索文件
用法
在脚本中
>>>fromservice.repo_scoutimportRepoScout>>>scout=RepoScout('GitHub')>>>scout.find('Parcks','plugins','Laravel.ppl')u'https://raw.githubusercontent.com/Parcks/plugins/master/debian/Laravel.ppl'
从cli
参数
-h, --help show this help message and exit -p, --provider PROV The name of the VCS provider (Default: GitHub) -o, --owner OWNER The name of the owner of the repository -n, --name NAME The name of the repository to search in -m, --method METHOD Indicates if the file should be searched in a directory or just retrieve the first occurrence (Default: First) -f, --file FILE The name of the file to find -d, --directory DIR The path in the repository where the file should be searched
示例
查找第一个匹配项
jvalck@Setarit-DTP:~/repo_scout$ python main.py -o Parcks -n plugins -f Laravel.ppl
https://raw.githubusercontent.com/Parcks/plugins/master/debian/Laravel.ppl
在目录中查找
示例1:一级深度
jvalck@Setarit-DTP:~/repo_scout$ rscout -o Parcks -n plugins -f Laravel.ppl -m InDirectory -d debian
https://raw.githubusercontent.com/Parcks/plugins/master/debian/Laravel.ppl
示例2:两层深度
jvalck@Setarit-DTP:~/repo_scout$ rscout -o Parcks -n core -f user_input.py -m InDirectory -d src/cli
https://raw.githubusercontent.com/Parcks/core/master/src/cli/user_input.py
示例1:一级深度
jvalck@Setarit-DTP:~/repo_scout$ rscout -o Parcks -n plugins -f Laravel.ppl -m InDirectory -d debian https://raw.githubusercontent.com/Parcks/plugins/master/debian/Laravel.ppl
示例2:两层深度
jvalck@Setarit-DTP:~/repo_scout$ rscout -o Parcks -n core -f user_input.py -m InDirectory -d src/cli https://raw.githubusercontent.com/Parcks/core/master/src/cli/user_input.py