FRACerqueira / PromptPlus

Interactive command-line toolkit for .Net core with powerful controls and commands to create professional console applications.
https://fracerqueira.github.io/PromptPlus/
MIT License
50 stars 5 forks source link

More output functions for PromptPlus.Error #66

Closed ividyon closed 1 year ago

ividyon commented 1 year ago

I noticed that PromptPlus.Error seems to only support WriteLine in terms of output. However PromptPlus has other interesting methods, such as Write, DoubleDash, SingleDash etc. I believe those should also be supported for the outerr stream.

FRACerqueira commented 1 year ago

@ividyon , I don't understand this problem well, could you make it clearer by giving an example of what you want?

ividyon commented 1 year ago

There are:

PromptPlus.WriteLine("text")
PromptPlus.SingleDash("text")
PromptPlus.DoubleDash("text")
// ...

for the regular PromptPlus console output.

This console output is directed to the stdout stream.

There is also

PromptPlus.Error.WriteLine("text")

to direct lines to the stderr stream, which is good practice for diagnostic output from a console application.

But there are no:

PromptPlus.Error.SingleDash("text")
PromptPlus.Error.DoubleDash("text")
// ...

and other such printing functions.

FRACerqueira commented 1 year ago

Perfect, I understand!

FRACerqueira commented 1 year ago

@ividyon , 'm working on this implementation.

The implementation so far looks like this:

            //write to standard error output stream for any output included within 'using'
            using (PromptPlus.OutputError())
            {
                PromptPlus.DoubleDash("anytext");
                PromptPlus.WriteLine("Test");             
            }
ividyon commented 1 year ago

That's a very good way of solving it!

FRACerqueira commented 1 year ago

Fixed scheduled for publication 4.0.6