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

支持环境变量 #11

Closed
guonaihong opened this issue Feb 1, 2020 · 0 comments
Closed

支持环境变量 #11

guonaihong opened this issue Feb 1, 2020 · 0 comments

Comments

@guonaihong
Copy link
Owner

guonaihong commented Feb 1, 2020

伪代码如下

   type env struct {
        Url []string `clop:"-u; --url; env=CLOP-TEST-URL" usage:"URL to work with"`
    }

e := env{}
clop.Bind(&e)

行为约束.

  • 环境变量的解析放在命令行的后面
  • 如果写了多个环境变量配置,只有最后一个才生效
  • 环境变量的值为false时,bind到结构体里面也是false
guonaihong added a commit that referenced this issue Feb 3, 2020
guonaihong added a commit that referenced this issue Feb 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant