diff --git a/cmd/cloudflared/main.go b/cmd/cloudflared/main.go index 4b2941fc..61d2c41d 100644 --- a/cmd/cloudflared/main.go +++ b/cmd/cloudflared/main.go @@ -134,11 +134,22 @@ To determine if an update happened in a script, check for error code 11.`, { Name: "version", Action: func(c *cli.Context) (err error) { + if c.Bool("short") { + fmt.Println(strings.Split(c.App.Version, " ")[0]) + return nil + } version(c) return nil }, Usage: versionText, Description: versionText, + Flags: []cli.Flag{ + &cli.BoolFlag{ + Name: "short", + Aliases: []string{"s"}, + Usage: "print just the version number", + }, + }, }, } cmds = append(cmds, tunnel.Commands()...)