Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Command = &cli.Command{ Name: "qrcode", Usage: "二维码生成、解析", Aliases: []string{"q"}, Flags: Flags, Action: Action, }
View Source
var Flags = []cli.Flag{ &cli.StringFlag{ Name: "content", Aliases: []string{"c"}, Usage: "qrcode content", }, &cli.StringFlag{ Name: "filename", Aliases: []string{"f"}, Usage: "qrcode filename", Action: func(context *cli.Context, s string) error { if _, err := os.Stat(s); os.IsNotExist(err) { return fmt.Errorf("文件 %s 不存在,请重新选择文件", s) } ext := filepath.Ext(s) if common.Identify(ext) == false { return fmt.Errorf(common.ExtError) } return nil }, }, &cli.StringFlag{ Name: "url", Aliases: []string{"u"}, Usage: "qrcode url", Action: func(context *cli.Context, s string) error { u, err := url.Parse(s) if err != nil { return fmt.Errorf("url %s 解析失败,请重新输入", s) } ext := filepath.Ext(u.Path) if common.Identify(ext) == false { return fmt.Errorf(common.ExtError) } return nil }, }, }
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.