MCPcopy Create free account
hub / github.com/cloudfoundry/credhub-cli / PrintVersion

Function PrintVersion

commands/version.go:12–32  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

10)
11
12func PrintVersion() error {
13 cfg := config.ReadConfig()
14
15 credHubServerVersion := "Not Found. Have you targeted and authenticated against a CredHub server?"
16 fmt.Println("CLI Version:", version.Version)
17
18 if cfg.ApiURL != "" {
19 credhubClient, err := initializeCredhubClient(cfg)
20
21 if err == nil {
22 version, err := credhubClient.ServerVersion()
23 if err == nil {
24 credHubServerVersion = version.String()
25 }
26 }
27 }
28
29 fmt.Println("Server Version:", credHubServerVersion)
30
31 return nil
32}
33
34func init() {
35 CredHub.Version = func() {

Callers 1

initFunction · 0.85

Calls 4

ReadConfigFunction · 0.92
initializeCredhubClientFunction · 0.85
ServerVersionMethod · 0.80
StringMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…