Closed davetimmins closed 10 years ago
Awesome! Thanks very much. I'll review it ASAP. I'm on the road right now with a phone only so I'm afraid it will have to wait until next week. This is a great step towards spinning this off as a separate nupkg. On 25 Aug 2014 22:31, "Dave Timmins" notifications@github.com wrote:
This moves the ColorConsole stuff into a separate project. I left the usage within Bau the same with the exception of changing WriteLine(null) to just WriteLine().
There is also the option to call it as below
ColorConsole.WriteLine( "Press".Colored(ConsoleColor.Gray), " Esc ".Colored(ConsoleColor.Red), "to exit".Colored(ConsoleColor.Gray));
You can merge this Pull Request by running
git pull https://github.com/davetimmins/bau split-out-color-console
Or view, comment on, or merge it at:
https://github.com/bau-build/bau/pull/177 Commit Summary
- split ColorConsole out to separate project
File Changes
- M src/Bau.sln https://github.com/bau-build/bau/pull/177/files#diff-0 (14)
- M src/Bau/Arguments.cs https://github.com/bau-build/bau/pull/177/files#diff-1 (13)
- M src/Bau/Bau.cs https://github.com/bau-build/bau/pull/177/files#diff-2 (1)
- M src/Bau/Bau.csproj https://github.com/bau-build/bau/pull/177/files#diff-3 (9)
- M src/Bau/Log.cs https://github.com/bau-build/bau/pull/177/files#diff-4 (1)
- R src/ColoredConsole/ColorConsole.cs https://github.com/bau-build/bau/pull/177/files#diff-5 (14)
- R src/ColoredConsole/ColorText.cs https://github.com/bau-build/bau/pull/177/files#diff-6 (2)
- R src/ColoredConsole/ColorToken.cs https://github.com/bau-build/bau/pull/177/files#diff-7 (2)
- A src/ColoredConsole/ColoredConsole.csproj https://github.com/bau-build/bau/pull/177/files#diff-8 (56)
- A src/ColoredConsole/Properties/AssemblyInfo.cs https://github.com/bau-build/bau/pull/177/files#diff-9 (22)
- A src/ColoredConsole/StringExtensions.cs https://github.com/bau-build/bau/pull/177/files#diff-10 (16)
Patch Links:
— Reply to this email directly or view it on GitHub https://github.com/bau-build/bau/pull/177.
No problem. Yea would be great as a package, been using it for a recent project as there's nothing else as nice / easy to use from what I could see.
Also noticed that if you do something like
ColorConsole.WriteLine(
"Press",
" Esc ".Colored(ConsoleColor.Red),
"to exit");
at the moment it will use the last set colour, so "Esc to exit", would all be red. Changing the implicit string operator for ColorToken to use the default colour of white can resolve this
public static implicit operator ColourToken(string text)
{
return new ColourToken(text, ConsoleColor.White);
}
Thanks for hanging in there. I'm afraid I still can't get onto this for a while, but the behaviour you mention surprises me. I thought I designed it so that the current colour is reverted after the rendering of each token but I guess I may be mistaken.
Ah you're right, must've been imagining things sorry :sob:
@davetimmins sorry there's been no movement on this for a while.
I had a think about it and I decided that I didn't really want the project sitting as a separate DLL in Bau, but your change inspired me to go the whole hog and spin it off as a separate repo and package. See https://github.com/colored-console/colored-console and https://www.nuget.org/packages/ColoredConsole/.
The new repo is based on the current dev branch in Bau, so it doesn't contain the API enhancements you made, i.e. the WriteLine
overloads and the string
extension method. If you'd like to raise a PR over at the colored-console project I'd be more than happy to accept them there.
Furthermore, given your interest, would you like to join me in co-managing the colored-console repo as a committer?
That's great and good timing as I am about to use it again. I'll make the changes over there and submit a new PR.
Yes I'd be happy to co-manage the colored-console repository.
Great! I've invited you to become an owner of the colored-console org. I'll take a look at your PR there ASAP.
This moves the
ColorConsole
stuff into a separate project. I left the usage withinBau
the same with the exception of changingWriteLine(null)
to justWriteLine()
.There is also the option to call it as below