From 11cf45f96a78aaf61bc470f1b0b8be6bc9788adc Mon Sep 17 00:00:00 2001 From: yeya24 Date: Tue, 20 Aug 2019 15:32:38 +0800 Subject: [PATCH] cleanup some useless dfget config fields Signed-off-by: yeya24 --- cmd/dfget/app/root_test.go | 2 -- dfget/config/config.go | 6 ------ dfget/config/config_test.go | 3 +-- 3 files changed, 1 insertion(+), 10 deletions(-) diff --git a/cmd/dfget/app/root_test.go b/cmd/dfget/app/root_test.go index ed6f967fe..b2e0a5517 100644 --- a/cmd/dfget/app/root_test.go +++ b/cmd/dfget/app/root_test.go @@ -45,11 +45,9 @@ func (suit *dfgetSuit) Test_initFlagsNoArguments() { suit.Equal(cfg.TotalLimit, 0) suit.Equal(cfg.Notbs, false) suit.Equal(cfg.DFDaemon, false) - suit.Equal(cfg.Version, false) suit.Equal(cfg.ShowBar, false) suit.Equal(cfg.Console, false) suit.Equal(cfg.Verbose, false) - suit.Equal(cfg.Help, false) suit.Equal(cfg.URL, "") } diff --git a/dfget/config/config.go b/dfget/config/config.go index 40147c8b6..5b72d5167 100644 --- a/dfget/config/config.go +++ b/dfget/config/config.go @@ -191,9 +191,6 @@ type Config struct { // Insecure indicates whether skip secure verify when supernode interact with the source. Insecure bool `json:"insecure,omitempty"` - // Version show version. - Version bool `json:"version,omitempty"` - // ShowBar show progress bar, it's conflict with `--console`. ShowBar bool `json:"showBar,omitempty"` @@ -204,9 +201,6 @@ type Config struct { // If set true, log level will be 'debug'. Verbose bool `json:"verbose,omitempty"` - // Help show help information. - Help bool `json:"help,omitempty"` - // ClientQueueSize is the size of client queue // which controls the number of pieces that can be processed simultaneously. // It is only useful when the pattern not equals "source". diff --git a/dfget/config/config_test.go b/dfget/config/config_test.go index 7e9a2475e..9c16503be 100644 --- a/dfget/config/config_test.go +++ b/dfget/config/config_test.go @@ -58,9 +58,8 @@ func (suite *ConfigSuite) TestConfig_String(c *check.C) { c.Assert(strings.Contains(cfg.String(), expected), check.Equals, true) cfg.LocalLimit = 20971520 cfg.Pattern = "p2p" - cfg.Version = true expected = "\"url\":\"\",\"output\":\"\",\"localLimit\":20971520," + - "\"pattern\":\"p2p\",\"version\":true" + "\"pattern\":\"p2p\"" c.Assert(strings.Contains(cfg.String(), expected), check.Equals, true) }