File: version.go

package info (click to toggle)
golang-step-cli-utils 0.7.5%2Bds-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 404 kB
  • sloc: makefile: 19
file content (28 lines) | stat: -rw-r--r-- 591 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package version

import (
	"fmt"

	"github.com/urfave/cli"
	"go.step.sm/cli-utils/command"
	"go.step.sm/cli-utils/step"
)

func init() {
	cmd := cli.Command{
		Name:        "version",
		Usage:       "display the current version of the cli",
		UsageText:   "**step version**",
		Description: `**step version** prints the version of the cli.`,
		Action:      Command,
	}

	command.Register(cmd)
}

// Command prints out the current version of the tool
func Command(c *cli.Context) error {
	fmt.Printf("%s\n", step.Version())
	fmt.Printf("Release Date: %s\n", step.ReleaseDate())
	return nil
}