Change option IncludeSeconds to RequireSeconds #88
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hiya. Feel free to ignore this PR if it's not what you had in mind.
For my uses, having to specify via an options file whether I want to include seconds in the cron expression or not is a little tedious, and you already have nearly all the infrastructure in place to handle either 5 or 6 tokens automatically. So this is me giving it that one final push. Now whenever
RequireSeconds
is set true, the parser will throw only if Seconds are missing. Otherwise, if it's false, it'll accept 5 or 6 tokens without issue.Sorry for all the renaming. The meat-and-potatoes of this change is a new test method,
CrontabScheduleTests.CanParseEitherFormatWhenSecondsAreNotRequired
, and the slightly modified implementation ofCrontabSchedule.TryParse<T>
.Let me know what you think and if you'd like me to make any changes. Thanks for making this! Very useful :)