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

命令行模式的支持 #20

Closed
bestony opened this issue Oct 5, 2018 · 1 comment
Closed

命令行模式的支持 #20

bestony opened this issue Oct 5, 2018 · 1 comment
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@bestony
Copy link
Member

bestony commented Oct 5, 2018

「命令行模式的支持」

即所有参数均由命令行来提供,如

grank --token=xxx repo lctt grank --start=2018-08-01 --stop=2018-09-01

实现方法

  1. 参考 http://click.palletsprojects.com/en/7.x/options/ 的文档,加入 option ,加入位置大致在

    Grank/grank/core.py

    Lines 16 to 19 in 7259124

    @click.group()
    def main():
    """Grank Command"""
    pass
    (未测试)

  2. 检测到 Option 后,手动生成一个 config 实例,不再通过文件读取。可能涉及到 context 的传递,参考 http://click.palletsprojects.com/en/7.x/commands/#nested-handling-and-contexts

@bestony bestony added enhancement New feature or request good first issue Good for newcomers labels Oct 5, 2018
@bestony
Copy link
Member Author

bestony commented Oct 13, 2018

fixed by LuuMing

@bestony bestony closed this as completed Oct 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant