liuxiaolong
2022-06-28 37714b1093c04061e636e5b1d27179652e671c0a
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
29
package command
 
import (
    "fmt"
 
    "basic.com/valib/serf.git/serf"
    "github.com/mitchellh/cli"
)
 
// VersionCommand is a Command implementation prints the version.
type VersionCommand struct {
    Version string
    UI      cli.Ui
}
 
func (c *VersionCommand) Help() string {
    return ""
}
 
func (c *VersionCommand) Run(_ []string) int {
    c.UI.Output(c.Version)
    c.UI.Output(fmt.Sprintf("Agent Protocol: %d (Understands back to: %d)",
        serf.ProtocolVersionMax, serf.ProtocolVersionMin))
    return 0
}
 
func (c *VersionCommand) Synopsis() string {
    return "Prints the Serf version"
}