From c29a09ef86a9bdb7edab63d5c355dcfc393160f5 Mon Sep 17 00:00:00 2001 From: Carlos Salguero Date: Sun, 13 Oct 2019 13:51:44 -0300 Subject: [PATCH] Fixed default params --- .goreleaser.yml | 28 +++++++++++ Gopkg.lock | 112 ++++++++++++++++++++++++++++------------- Gopkg.toml | 36 +++++++++---- README.md | 4 ++ coverage.out | 131 ------------------------------------------------ main.go | 18 +++++-- 6 files changed, 149 insertions(+), 180 deletions(-) create mode 100644 .goreleaser.yml delete mode 100644 coverage.out diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 0000000..9b946ca --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,28 @@ +# This is an example goreleaser.yaml file with some sane defaults. +# Make sure to check the documentation at http://goreleaser.com +before: + hooks: + # you may remove this if you don't use vgo + - go mod tidy + # you may remove this if you don't need go generate + - go generate ./... +builds: +- env: + - CGO_ENABLED=0 +archives: +- replacements: + darwin: Darwin + linux: Linux + windows: Windows + 386: i386 + amd64: x86_64 +checksum: + name_template: 'checksums.txt' +snapshot: + name_template: "{{ .Tag }}-next" +changelog: + sort: asc + filters: + exclude: + - '^docs:' + - '^test:' diff --git a/Gopkg.lock b/Gopkg.lock index ec6395b..afccfe0 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -3,124 +3,166 @@ [[projects]] branch = "master" + digest = "1:125f098c5294814b5d9ce2194f03a435c35a6208f029e61681bed9a893d68133" name = "github.com/alecthomas/template" packages = [ ".", - "parse" + "parse", ] - revision = "a0175ee3bccc567396460bf5acd36800cb10c49c" + pruneopts = "UT" + revision = "fb15b899a75114aa79cc930e33c46b577cc664b1" [[projects]] branch = "master" + digest = "1:f780e2e814981de9dbdc2ca49d6c91d4aa4e2a1639ebc4106fafb0dc54fa5bd8" name = "github.com/alecthomas/units" packages = ["."] - revision = "2efee857e7cfd4f3d0138cc3cbb1b4966962b93a" + pruneopts = "UT" + revision = "f65c72e2690dc4b403c8bd637baf4611cd4c069b" [[projects]] - branch = "master" + digest = "1:b06d27db2f87588507f245345f329b4192809e72ab32385a26a6eb25988eb82e" name = "github.com/corpix/uarand" packages = ["."] - revision = "2b8494104d86337cdd41d0a49cbed8e4583c0ab4" + pruneopts = "UT" + revision = "031be390f409fb4bac8fb299e3bcd101479f89f8" [[projects]] + digest = "1:2d8307a7345570ece92d85e80f17c9de719fa44a11f5ccd828ab2bb4a328314c" name = "github.com/go-ini/ini" packages = ["."] - revision = "5cf292cae48347c2490ac1a58fe36735fb78df7e" - version = "v1.38.2" + pruneopts = "UT" + revision = "700781759788472518f4ea52321519b066061a7b" + version = "v1.48.0" [[projects]] + digest = "1:ec6f9bf5e274c833c911923c9193867f3f18788c461f76f05f62bb1510e0ae65" name = "github.com/go-sql-driver/mysql" packages = ["."] - revision = "d523deb1b23d913de5bdada721a6071e71283618" - version = "v1.4.0" + pruneopts = "UT" + revision = "72cd26f257d44c1114970e19afddcd812016007e" + version = "v1.4.1" [[projects]] - branch = "master" + digest = "1:e6e8ee8a9aa4efb33290bd5e6615822635884bc007923359e3a10b57eff36bb3" name = "github.com/gosuri/uilive" packages = ["."] - revision = "ac356e6e42cd31fcef8e6aec13ae9ed6fe87713e" + pruneopts = "UT" + revision = "4512d98b127f3f3a1b7c3cf1104969fdd17b31d9" + version = "v0.0.3" [[projects]] - branch = "master" + digest = "1:f6ae4b3c3d4411bffa0b8045fff29974e1eb866e1828786972059f89a130aecf" name = "github.com/gosuri/uiprogress" packages = [ ".", - "util/strutil" + "util/strutil", ] + pruneopts = "UT" revision = "d0567a9d84a1c40dd7568115ea66f4887bf57b33" + version = "0.0.1" [[projects]] + digest = "1:88e0b0baeb9072f0a4afbcf12dda615fc8be001d1802357538591155998da21b" name = "github.com/hashicorp/go-version" packages = ["."] - revision = "b5a281d3160aa11950a6182bd9a9dc2cb1e02d50" - version = "v1.0.0" + pruneopts = "UT" + revision = "ac23dc3fea5d1a983c43f6a0f6e2c13f0195d8bd" + version = "v1.2.0" [[projects]] branch = "master" + digest = "1:22725c01ecd8ed0c0f0078944305a57053340d92878b02db925c660cc4accf64" name = "github.com/icrowley/fake" packages = ["."] + pruneopts = "UT" revision = "4178557ae428460c3780a381c824a1f3aceb6325" [[projects]] + digest = "1:31e761d97c76151dde79e9d28964a812c46efc5baee4085b86f68f0c654450de" + name = "github.com/konsorten/go-windows-terminal-sequences" + packages = ["."] + pruneopts = "UT" + revision = "f55edac94c9bbba5d6182a4be46d86a2c9b5b50e" + version = "v1.0.2" + +[[projects]] + digest = "1:ca955a9cd5b50b0f43d2cc3aeb35c951473eeca41b34eb67507f1dbcc0542394" name = "github.com/kr/pretty" packages = ["."] + pruneopts = "UT" revision = "73f6ac0b30a98e433b289500d779f50c1a6f0712" version = "v0.1.0" [[projects]] + digest = "1:15b5cc79aad436d47019f814fde81a10221c740dc8ddf769221a65097fb6c2e9" name = "github.com/kr/text" packages = ["."] + pruneopts = "UT" revision = "e2ffdb16a802fe2bb95e2e35ff34f0e53aeef34f" version = "v0.1.0" [[projects]] + digest = "1:d62282425ffb75047679d7e2c3b980eea7f82c05ef5fb9142ee617ebac6e7432" name = "github.com/mattn/go-isatty" packages = ["."] - revision = "6ca4dbf54d38eea1a992b3c722a76a5d1c4cb25c" - version = "v0.0.4" + pruneopts = "UT" + revision = "88ba11cfdc67c7588b30042edf244b2875f892b6" + version = "v0.0.10" [[projects]] + digest = "1:cf31692c14422fa27c83a05292eb5cbe0fb2775972e8f1f8446a71549bd8980b" name = "github.com/pkg/errors" packages = ["."] - revision = "645ef00459ed84a119197bfb8d8205042c6df63d" - version = "v0.8.0" + pruneopts = "UT" + revision = "ba968bfe8b2f7e042a574c888954fccecfa385b4" + version = "v0.8.1" [[projects]] + digest = "1:04457f9f6f3ffc5fea48e71d62f2ca256637dee0a04d710288e27e05c8b41976" name = "github.com/sirupsen/logrus" packages = ["."] - revision = "3e01752db0189b9157070a0e1668a620f9a85da2" - version = "v1.0.6" - -[[projects]] - branch = "master" - name = "golang.org/x/crypto" - packages = ["ssh/terminal"] - revision = "0709b304e793a5edb4a2c0145f281ecdc20838a4" + pruneopts = "UT" + revision = "839c75faf7f98a33d445d181f3018b5c3409a45e" + version = "v1.4.2" [[projects]] branch = "master" + digest = "1:7c927f17d868be652a4cfe7de23e4292dea5b14d974a1d536e3b7cb7e79fd695" name = "golang.org/x/sys" - packages = [ - "unix", - "windows" - ] - revision = "d0be0721c37eeb5299f245a996a483160fc36940" + packages = ["unix"] + pruneopts = "UT" + revision = "b09406accb4736d857a32bf9444cd7edae2ffa79" [[projects]] + digest = "1:c25289f43ac4a68d88b02245742347c94f1e108c534dda442188015ff80669b3" name = "google.golang.org/appengine" packages = ["cloudsql"] - revision = "b1f26356af11148e710935ed1ac8a7f5702c7612" - version = "v1.1.0" + pruneopts = "UT" + revision = "971852bfffca25b069c31162ae8f247a3dba083b" + version = "v1.6.5" [[projects]] + digest = "1:c06d9e11d955af78ac3bbb26bd02e01d2f61f689e1a3bce2ef6fb683ef8a7f2d" name = "gopkg.in/alecthomas/kingpin.v2" packages = ["."] + pruneopts = "UT" revision = "947dcec5ba9c011838740e680966fd7087a71d0d" version = "v2.2.6" [solve-meta] analyzer-name = "dep" analyzer-version = 1 - inputs-digest = "2c2fd1aa913bfca3c44d61530b6d12610bc4aef0ff9ced3b763ae0150237dd71" + input-imports = [ + "github.com/go-ini/ini", + "github.com/go-sql-driver/mysql", + "github.com/gosuri/uiprogress", + "github.com/hashicorp/go-version", + "github.com/icrowley/fake", + "github.com/kr/pretty", + "github.com/pkg/errors", + "github.com/sirupsen/logrus", + "gopkg.in/alecthomas/kingpin.v2", + ] solver-name = "gps-cdcl" solver-version = 1 diff --git a/Gopkg.toml b/Gopkg.toml index 4c08b4e..f6c7e07 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -1,7 +1,6 @@ - # Gopkg.toml example # -# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md +# Refer to https://golang.github.io/dep/docs/Gopkg.toml.html # for detailed Gopkg.toml documentation. # # required = ["github.com/user/thing/cmd/thing"] @@ -17,34 +16,51 @@ # source = "github.com/myfork/project2" # # [[override]] -# name = "github.com/x/y" -# version = "2.4.0" +# name = "github.com/x/y" +# version = "2.4.0" +# +# [prune] +# non-go = false +# go-tests = true +# unused-packages = true +[[constraint]] + name = "github.com/go-ini/ini" + version = "1.48.0" + [[constraint]] name = "github.com/go-sql-driver/mysql" - version = "1.3.0" + version = "1.4.1" [[constraint]] - branch = "master" name = "github.com/gosuri/uiprogress" + version = "0.0.1" [[constraint]] - branch = "master" name = "github.com/hashicorp/go-version" + version = "1.2.0" [[constraint]] branch = "master" name = "github.com/icrowley/fake" [[constraint]] - branch = "master" name = "github.com/kr/pretty" + version = "0.1.0" [[constraint]] name = "github.com/pkg/errors" - version = "0.8.0" + version = "0.8.1" + +[[constraint]] + name = "github.com/sirupsen/logrus" + version = "1.4.2" [[constraint]] name = "gopkg.in/alecthomas/kingpin.v2" - version = "2.2.5" + version = "2.2.6" + +[prune] + go-tests = true + unused-packages = true diff --git a/README.md b/README.md index 11f4768..b81e9c9 100644 --- a/README.md +++ b/README.md @@ -172,6 +172,10 @@ https://github.com/Percona-Lab/mysql_random_data_load/releases ## Version history +#### 0.1.10 +- Fixed argument validations +- Fixed ~/.my.cnf loading + #### 0.1.10 - Fixed connection parameters for MySQL 5.7 (set driver's AllowNativePasswords: true) diff --git a/coverage.out b/coverage.out deleted file mode 100644 index 87c498c..0000000 --- a/coverage.out +++ /dev/null @@ -1,131 +0,0 @@ -mode: count -github.com/Percona-Lab/mysql_random_data_load/main.go:72.13,75.14 2 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:83.2,83.16 1 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:88.2,90.28 3 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:93.2,93.16 1 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:97.2,107.16 3 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:110.2,113.72 2 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:119.2,120.16 2 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:126.2,127.12 2 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:131.2,133.29 2 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:141.2,141.23 1 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:145.2,145.23 1 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:149.2,149.21 1 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:153.2,153.13 1 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:164.2,172.12 8 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:184.2,185.18 2 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:189.2,190.16 2 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:193.2,194.19 2 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:204.2,206.26 3 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:209.2,209.52 1 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:219.2,220.13 2 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:223.2,223.12 1 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:75.14,82.3 6 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:83.16,86.3 2 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:90.28,92.3 1 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:93.16,95.3 1 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:107.16,108.13 1 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:113.72,117.3 3 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:120.16,124.3 3 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:127.12,130.3 2 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:133.29,135.36 2 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:135.36,138.4 2 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:141.23,143.3 1 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:145.23,147.3 1 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:149.21,151.3 1 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:153.13,155.3 1 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:172.12,176.113 4 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:176.113,181.4 4 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:185.18,187.3 1 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:190.16,192.3 1 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:194.19,197.17 3 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:197.17,199.4 1 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:206.26,208.3 1 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:209.52,211.17 2 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:215.3,216.27 2 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:211.17,213.4 1 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:220.13,222.3 1 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:227.110,228.16 1 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:231.2,238.22 7 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:242.2,246.16 4 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:275.2,277.21 3 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:228.16,230.3 1 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:238.22,240.3 1 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:246.16,250.33 4 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:254.3,256.23 3 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:259.3,260.27 2 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:264.3,272.6 8 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:250.33,253.4 2 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:256.23,258.4 1 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:260.27,261.12 1 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:280.42,282.29 2 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:285.2,285.12 1 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:282.29,284.3 1 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:293.59,296.12 3 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:306.2,306.20 1 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:296.12,297.30 1 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:304.3,304.25 1 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:297.30,299.33 2 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:302.4,302.22 1 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:299.33,301.5 1 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:319.81,320.29 1 1 -github.com/Percona-Lab/mysql_random_data_load/main.go:320.29,322.30 2 3 -github.com/Percona-Lab/mysql_random_data_load/main.go:325.3,325.24 1 3 -github.com/Percona-Lab/mysql_random_data_load/main.go:322.30,324.4 1 9 -github.com/Percona-Lab/mysql_random_data_load/main.go:329.58,337.2 3 1 -github.com/Percona-Lab/mysql_random_data_load/main.go:339.105,341.16 2 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:349.2,350.16 2 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:353.2,355.11 3 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:341.16,347.3 5 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:350.16,352.3 1 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:359.76,361.31 2 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:410.2,410.15 1 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:361.31,363.52 1 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:366.3,366.30 1 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:378.3,379.45 2 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:382.3,382.25 1 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:363.52,364.12 1 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:366.30,371.18 2 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:375.4,376.12 2 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:371.18,373.13 2 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:379.45,381.4 1 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:383.71,384.95 1 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:385.37,387.78 1 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:388.39,390.59 1 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:391.15,392.86 1 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:393.32,394.90 1 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:395.75,397.59 1 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:398.15,399.68 1 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:400.15,402.49 1 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:403.22,404.87 1 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:405.11,406.83 1 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:413.57,415.31 2 1 -github.com/Percona-Lab/mysql_random_data_load/main.go:425.2,425.19 1 1 -github.com/Percona-Lab/mysql_random_data_load/main.go:415.31,416.39 1 13 -github.com/Percona-Lab/mysql_random_data_load/main.go:419.3,420.52 1 13 -github.com/Percona-Lab/mysql_random_data_load/main.go:423.3,423.63 1 12 -github.com/Percona-Lab/mysql_random_data_load/main.go:416.39,417.12 1 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:420.52,421.12 1 1 -github.com/Percona-Lab/mysql_random_data_load/main.go:428.115,433.63 4 1 -github.com/Percona-Lab/mysql_random_data_load/main.go:437.2,437.21 1 1 -github.com/Percona-Lab/mysql_random_data_load/main.go:444.2,445.16 2 1 -github.com/Percona-Lab/mysql_random_data_load/main.go:448.2,452.18 3 1 -github.com/Percona-Lab/mysql_random_data_load/main.go:480.2,480.35 1 1 -github.com/Percona-Lab/mysql_random_data_load/main.go:483.2,483.20 1 1 -github.com/Percona-Lab/mysql_random_data_load/main.go:433.63,435.3 1 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:437.21,439.3 1 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:439.3,442.3 1 1 -github.com/Percona-Lab/mysql_random_data_load/main.go:445.16,447.3 1 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:452.18,456.19 3 100 -github.com/Percona-Lab/mysql_random_data_load/main.go:475.3,475.17 1 100 -github.com/Percona-Lab/mysql_random_data_load/main.go:478.3,478.31 1 100 -github.com/Percona-Lab/mysql_random_data_load/main.go:457.79,460.11 3 100 -github.com/Percona-Lab/mysql_random_data_load/main.go:462.41,465.11 3 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:466.37,469.11 3 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:470.48,473.11 3 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:475.17,477.4 1 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:480.35,482.3 1 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:486.35,487.64 1 14 -github.com/Percona-Lab/mysql_random_data_load/main.go:490.2,490.41 1 14 -github.com/Percona-Lab/mysql_random_data_load/main.go:487.64,489.3 1 0 -github.com/Percona-Lab/mysql_random_data_load/main.go:493.45,523.2 3 13 diff --git a/main.go b/main.go index 9ff7f83..07362ae 100644 --- a/main.go +++ b/main.go @@ -88,6 +88,7 @@ type insertFunction func(*sql.DB, string, chan int, chan bool, *sync.WaitGroup) const ( defaultMySQLConfigSection = "client" defaultConfigFile = "~/.my.cnf" + defaultBulkSize = 1000 ) func main() { @@ -160,9 +161,18 @@ func main() { } } + if *opts.Rows < 1 { + db.Close() // golint:noerror + log.Warnf("Number of rows < 1. There is nothing to do. Exiting") + os.Exit(1) + } + if *opts.BulkSize > *opts.Rows { *opts.BulkSize = *opts.Rows } + if *opts.BulkSize < 1 { + *opts.BulkSize = defaultBulkSize + } if opts.MaxThreads == nil { *opts.MaxThreads = runtime.NumCPU() * 10 @@ -557,16 +567,16 @@ func processCliParams() (*cliOptions, error) { opts := &cliOptions{ app: app, - BulkSize: app.Flag("bulk-size", "Number of rows per insert statement").Default("1000").Int(), - ConfigFile: app.Flag("config-file", "MySQL config file").Default(defaultConfigFile).String(), + BulkSize: app.Flag("bulk-size", "Number of rows per insert statement").Default(fmt.Sprintf("%d", defaultBulkSize)).Int(), + ConfigFile: app.Flag("config-file", "MySQL config file").Default(expandHomeDir(defaultConfigFile)).String(), Debug: app.Flag("debug", "Log debugging information").Bool(), Factor: app.Flag("fk-samples-factor", "Percentage used to get random samples for foreign keys fields").Default("0.3").Float64(), - Host: app.Flag("host", "Host name/IP").Short('h').Default("127.0.0.1").String(), + Host: app.Flag("host", "Host name/IP").Short('h').String(), MaxRetries: app.Flag("max-retries", "Number of rows to insert").Default("100").Int(), MaxThreads: app.Flag("max-threads", "Maximum number of threads to run inserts").Default("1").Int(), NoProgress: app.Flag("no-progress", "Show progress bar").Default("false").Bool(), Pass: app.Flag("password", "Password").Short('p').String(), - Port: app.Flag("port", "Port").Short('P').Default("3306").Int(), + Port: app.Flag("port", "Port").Short('P').Int(), Print: app.Flag("print", "Print queries to the standard output instead of inserting them into the db").Bool(), Samples: app.Flag("max-fk-samples", "Maximum number of samples for foreign keys fields").Default("100").Int64(), User: app.Flag("user", "User").Short('u').String(),