photoprism/internal/commands/version.go

26 lines
453 B
Go
Raw Normal View History

2018-12-21 03:32:17 +00:00
package commands
import (
"fmt"
"github.com/urfave/cli"
"github.com/photoprism/photoprism/internal/config"
2018-12-21 03:32:17 +00:00
)
// VersionCommand registers the version cli command.
2018-12-21 03:32:17 +00:00
var VersionCommand = cli.Command{
Name: "version",
Usage: "Shows version information",
2018-12-21 03:32:17 +00:00
Action: versionAction,
}
// versionAction prints the current version
2018-12-21 03:32:17 +00:00
func versionAction(ctx *cli.Context) error {
conf := config.NewConfig(ctx)
2018-12-21 03:32:17 +00:00
fmt.Println(conf.Version())
2018-12-21 03:32:17 +00:00
return nil
}