diff --git a/README.md b/README.md index 9e973bc4..7dbdce6e 100644 --- a/README.md +++ b/README.md @@ -27,8 +27,6 @@ Options: Path to a file containing newline separated CVEs to be excluded (default "./.nancy-ignore") -no-color indicate output should not be colorized - -noColor - indicate output should not be colorized (deprecated: please use no-color) -quiet indicate output should contain only packages with vulnerabilities -version diff --git a/configuration/parse.go b/configuration/parse.go index e6f9bc52..5d441912 100644 --- a/configuration/parse.go +++ b/configuration/parse.go @@ -27,11 +27,9 @@ var unixComments = regexp.MustCompile(`#.*$`) func Parse(args []string) (Configuration, error) { config := Configuration{} var excludeVulnerabilityFilePath string - var noColorDeprecated bool flag.BoolVar(&config.Help, "help", false, "provides help text on how to use nancy") flag.BoolVar(&config.NoColor, "no-color", false, "indicate output should not be colorized") - flag.BoolVar(&noColorDeprecated, "noColor", false, "indicate output should not be colorized (deprecated: please use no-color)") flag.BoolVar(&config.Quiet, "quiet", false, "indicate output should contain only packages with vulnerabilities") flag.BoolVar(&config.Version, "version", false, "prints current nancy version") flag.BoolVar(&config.CleanCache, "clean-cache", false, "Deletes local cache directory") @@ -56,13 +54,6 @@ func Parse(args []string) (Configuration, error) { config.Path = args[len(args)-1] } - if noColorDeprecated == true { - fmt.Println("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!") - fmt.Println("!!!! DEPRECATION WARNING : Please change 'noColor' param to be 'no-color'. This one will be removed in a future release. !!!!") - fmt.Println("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!") - config.NoColor = noColorDeprecated - } - err = getCVEExcludesFromFile(&config, excludeVulnerabilityFilePath) if err != nil { return config, err diff --git a/configuration/parse_test.go b/configuration/parse_test.go index 1a6260fd..d3a79759 100644 --- a/configuration/parse_test.go +++ b/configuration/parse_test.go @@ -48,7 +48,6 @@ CVN-543`) "defaults": {args: []string{"/tmp/go.sum"}, expectedConfig: Configuration{NoColor: false, Quiet: false, Version: false, CveList: types.CveListFlag{}, Path: "/tmp/go.sum"}, expectedErr: nil}, "help": {args: []string{"-help", "/tmp/go2.sum"}, expectedConfig: Configuration{Help: true, NoColor: false, Quiet: false, Version: false, CveList: types.CveListFlag{}, Path: "/tmp/go2.sum"}, expectedErr: nil}, "no color": {args: []string{"-no-color", "/tmp/go2.sum"}, expectedConfig: Configuration{NoColor: true, Quiet: false, Version: false, CveList: types.CveListFlag{}, Path: "/tmp/go2.sum"}, expectedErr: nil}, - "no color (deprecated)": {args: []string{"-noColor", "/tmp/go2.sum"}, expectedConfig: Configuration{NoColor: true, Quiet: false, Version: false, CveList: types.CveListFlag{}, Path: "/tmp/go2.sum"}, expectedErr: nil}, "quiet": {args: []string{"-quiet", "/tmp/go3.sum"}, expectedConfig: Configuration{NoColor: false, Quiet: true, Version: false, CveList: types.CveListFlag{}, Path: "/tmp/go3.sum"}, expectedErr: nil}, "version": {args: []string{"-version", "/tmp/go4.sum"}, expectedConfig: Configuration{NoColor: false, Quiet: false, Version: true, CveList: types.CveListFlag{}, Path: "/tmp/go4.sum"}, expectedErr: nil}, "exclude vulnerabilities": {args: []string{"-exclude-vulnerability=CVE123,CVE988", "/tmp/go5.sum"}, expectedConfig: Configuration{NoColor: false, Quiet: false, Version: false, CveList: types.CveListFlag{Cves: []string{"CVE123", "CVE988"}}, Path: "/tmp/go5.sum"}, expectedErr: nil},