@@ -34,10 +34,11 @@ var (
34
34
progress = app .Flag ("show-progressbar" , "Show progress bar" ).Default ("true" ).Bool ()
35
35
samples = app .Flag ("max-fk-samples" , "Maximum number of samples for foreign keys fields" ).Default ("100" ).Int64 ()
36
36
factor = app .Flag ("fk-samples-factor" , "Percentage used to get random samples for foreign keys fields" ).Default ("0.3" ).Float64 ()
37
+ version = app .Flag ("version" , "Show version and exit" ).Bool ()
37
38
//
38
- schema = app .Arg ("database" , "Database" ).Required (). String ()
39
- tableName = app .Arg ("table" , "Table" ).Required (). String ()
40
- rows = app .Arg ("rows" , "Number of rows to insert" ).Required (). Int ()
39
+ schema = app .Arg ("database" , "Database" ).String ()
40
+ tableName = app .Arg ("table" , "Table" ).String ()
41
+ rows = app .Arg ("rows" , "Number of rows to insert" ).Int ()
41
42
42
43
validFunctions = []string {"int" , "string" , "date" , "date_in_range" }
43
44
maxValues = map [string ]int64 {
51
52
"double" : 0x7FFFFFFF ,
52
53
"bigint" : 0x7FFFFFFFFFFFFFFF ,
53
54
}
55
+
56
+ Version = "0.0.0."
57
+ Commit = "<sha1>"
58
+ Branch = "branch-name"
59
+ Build = "2017-01-01"
60
+ GoVersion = "1.9.2"
54
61
)
55
62
56
63
type insertValues []getters.Getter
@@ -66,6 +73,15 @@ func (g insertValues) String() string {
66
73
func main () {
67
74
kingpin .MustParse (app .Parse (os .Args [1 :]))
68
75
76
+ if * version {
77
+ fmt .Printf ("Version : %s\n " , Version )
78
+ fmt .Printf ("Commit : %s\n " , Commit )
79
+ fmt .Printf ("Branch : %s\n " , Branch )
80
+ fmt .Printf ("Build : %s\n " , Build )
81
+ fmt .Printf ("Go version: %s\n " , GoVersion )
82
+ return
83
+ }
84
+
69
85
address := * host
70
86
net := "unix"
71
87
if address != "localhost" {
0 commit comments