diff --git a/source/dub/commandline.d b/source/dub/commandline.d index fb6186e..8fefab9 100644 --- a/source/dub/commandline.d +++ b/source/dub/commandline.d @@ -167,7 +167,7 @@ options.root_path = options.root_path.expandTilde.absolutePath.buildNormalizedPath; } - final switch (options.colors_mode) with (options.colors) + final switch (options.color_mode) with (options.color) { case automatic: // Use default determined in internal.logging.initLogging(). @@ -562,8 +562,8 @@ bool help, annotate, bare; string[] registry_urls; string root_path; - enum colors { automatic, on, off } // Style violation in support of invalid option error formatting. - colors colors_mode = colors.automatic; + enum color { automatic, on, off } // Lower case "color" in support of invalid option error formatting. + color color_mode = color.automatic; SkipPackageSuppliers skipRegistry = SkipPackageSuppliers.none; PlacementLocation placementLocation = PlacementLocation.user; @@ -591,7 +591,7 @@ args.getopt("q|quiet", &quiet, ["Only print warnings and errors"]); args.getopt("verror", &verror, ["Only print errors"]); args.getopt("vquiet", &vquiet, ["Print no messages"]); - args.getopt("colors", &colors_mode, [ + args.getopt("color", &color_mode, [ "Configure colored output. Accepted values:", " automatic: Colored output on console/terminal,", " unless NO_COLOR is set and non-empty (default)", diff --git a/test/colored-output.sh b/test/colored-output.sh index afc1bb3..abb8766 100755 --- a/test/colored-output.sh +++ b/test/colored-output.sh @@ -4,14 +4,14 @@ cd ${CURR_DIR}/1-exec-simple -# Test --colors=off disabling colors correctly -${DUB} build --colors=off --compiler=${DC} 2>&1 | { ! \grep $'^\x1b\[' -c; } +# Test that --color=off disables colors correctly +${DUB} build --color=off --compiler=${DC} 2>&1 | { ! \grep $'^\x1b\[' -c; } -# Test --colors=automatic detecting no TTY -${DUB} build --colors=automatic --compiler=${DC} 2>&1 | { ! \grep $'^\x1b\[' -c; } +# Test that --color=automatic detects no TTY correctly +${DUB} build --color=automatic --compiler=${DC} 2>&1 | { ! \grep $'^\x1b\[' -c; } -# Test no --colors= option defaulting to automatic +# Test that no --color= has same behaviour as --color=automatic ${DUB} build --compiler=${DC} 2>&1 | { ! \grep $'^\x1b\[' -c; } -# Test --colors=on enabling colors in any case -${DUB} build --colors=on --compiler=${DC} 2>&1 | \grep $'^\x1b\[' -c +# Test that --color=on enables colors in any case +${DUB} build --color=on --compiler=${DC} 2>&1 | \grep $'^\x1b\[' -c