photoprism/internal/commands/version.go

25 lines
461 B
Go
Raw Normal View History

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