question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

--version does not print a new line at the end

See original GitHub issue

Using 2.4.3 on linux, I get the following behavior when calling --version (using the auto-generated help text):

$ dotnet run --version
strans 0.0.2$

The output does not terminate in a line break. This looks very ugly. Instead, it should be:

$ dotnet run --version
strans 0.0.2
$

All other commands nicely finish in a newline.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6

github_iconTop GitHub Comments

2reactions
Inventitechcommented, Mar 12, 2019

My workaround is to check whether the version is requested, and if so, append a newline:

return Parser.Default.ParseArguments<Options>(args)
                .MapResult(
                    options => run(options),
                    errors => handleErrors(errors));

...

static int handleErrors(IEnumerable<Error> errors)
{
      if(errors.Any(l => l.GetType() == typeof(VersionRequestedError))) {
           Console.Out.WriteLine();
       }
            
      return 0;
}
0reactions
twaalewijncommented, May 7, 2019

Edit: Never mind, even echo gives its result back like that so I guess it is just the way cmd does it. I guess I just never noticed it before.

Don’t know if it is a problem but thought I’d mention it anyway. The output, using the package above, running from a cmd prompt on Windows looks like this now:

>dotnet run --version
strans 0.0.2

>

Running from a powershell prompt seems unaffected though so maybe this is just how it was always supposed to look in cmd.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to print without a newline or space - python
In Python 2.x, you can just add , at the end of the print function, so it won't print on a new line....
Read more >
Python Print Without Newline: Step-by-Step Guide
Here's an example: print("Hello there!", end = '') The next print function will be on the same line. When you're programming, you may...
Read more >
How to print without newline in Python?
x, you can use a comma at the end of the print statement, just like in the given code. Python ...
Read more >
Python Print Without Newline: Easy Step-by-Step Guide
To print without a newline in Python, you can use the end and sep parameters in the print function, or use alternatives like...
Read more >
Here is how to print without a newline or space in Python
To print without a newline or space in Python, you can use the end parameter of the print() function. This parameter specifies the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found