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

必选项标记支持 #10

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

必选项标记支持 #10

guonaihong opened this issue Feb 1, 2020 · 0 comments

Comments

@guonaihong
Copy link
Owner

guonaihong commented Feb 1, 2020

加上这个选项,这个命令行选项,必须传入。

package main

import (
	"github.com/guonaihong/clop"
)

type gurl struct {
	Url  string `clop:"-u; --url" usage:"url" valid:"required"`
	Text string `clop:"-t; --text" usage:"text" valid:"required"`
}

func main() {

	g := gurl{}
	clop.Bind(&g)
	//fmt.Printf("%s\n", err)
}
guonaihong added a commit that referenced this issue Feb 26, 2020
guonaihong added a commit that referenced this issue Feb 28, 2020
guonaihong added a commit that referenced this issue Feb 28, 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