Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CommandLine.Parser.Default.FormatCommandLine incorrectly shows DateTime/DateTime? option #502

Closed
nknoop opened this issue Aug 14, 2019 · 2 comments
Milestone

Comments

@nknoop
Copy link

nknoop commented Aug 14, 2019

When you call the FormatCommandLine DateTime and DateTime? are not formatted correctly (if you feed the generated string back to the CommandLine it shows an error)

internal class Options
{
	[Option(
		longName: "start",
		Default = null,
		HelpText = "Some help text"
	)]
	public DateTime? Start { get; set; }
}

Formatted date looks something like this for me: 14/08/2019 09:51:12

There seem to be missing " quotations around it (or a T between the date and the time) also the formatting of the date is wrong, should be 2019-08-14

@moh-hassan
Copy link
Collaborator

@nknoop
Can you try the nuget dev Package on Ci Server to know if your issue is resolved.

moh-hassan added a commit that referenced this issue Dec 24, 2019
Add ability to skip options with default values for UnParserSettings (#541) and Quote DateTime (#502)
@moh-hassan
Copy link
Collaborator

online demo to show the fix in v2.7+

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants