本文整理汇总了Golang中github.com/codegangsta/cli.App.Version方法的典型用法代码示例。如果您正苦于以下问题:Golang App.Version方法的具体用法?Golang App.Version怎么用?Golang App.Version使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/codegangsta/cli.App
的用法示例。
在下文中一共展示了App.Version方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: describeApp
func describeApp(app *cli.App, version string) {
app.Name = "init-exporter"
app.Usage = "exports services described by Procfile to systemd"
app.Version = version
app.Flags = []cli.Flag{
cli.StringFlag{
Name: "n, appname",
Usage: "Application name (This name only affects the names of generated files)",
},
cli.BoolFlag{
Name: "c, uninstall",
Usage: "Remove scripts and helpers for a particular application",
},
cli.StringFlag{
Name: "config",
Value: defaultConfigPath,
Usage: "path to configuration file",
},
cli.StringFlag{
Name: "p, procfile",
Usage: "path to procfile",
},
cli.StringFlag{
Name: "f, format",
Usage: "Format of init files (upstart | systemd)",
},
}
}
示例2: setBasicInfos
func setBasicInfos(app *cli.App, appName string, version string) {
app.Name = appName
app.Version = version
app.Usage = "Focus on your tasks and let your code flow."
t := time.Now()
app.Copyright = "TechMantra - " + strconv.Itoa(t.Year())
}
示例3: main
func main() {
var app *cli.App
app = cli.NewApp()
app.Name = APP_NAME
app.Version = APP_VER
app.Usage = "email for mail sending, or web or none for run web interface!"
app.Commands = []cli.Command{
task.CmdWeb,
task.CmdEmail,
}
app.Flags = append(app.Flags, []cli.Flag{}...)
app.Run(os.Args)
}