Skip to content

Allow negative durations in conv cmd#17

Merged
jftuga merged 1 commit intomainfrom
enhancements
Nov 16, 2024
Merged

Allow negative durations in conv cmd#17
jftuga merged 1 commit intomainfrom
enhancements

Conversation

@jftuga
Copy link
Copy Markdown
Owner

@jftuga jftuga commented Nov 16, 2024

Before this patch, this error would occur when trying to use a negative duration:

$ dtmate conv "-2 hours 3 minutes 4 seconds" ms
Error: unknown shorthand flag: '2' in -2 hours 3 minutes 4 seconds

With this patch:

$ dtmate conv "-2 hours 3 minutes 4 seconds" ms
-123 minutes 4 seconds

Testing

  • conv_test.go has been updated to include many negative duration tests

Copy link
Copy Markdown
Owner Author

@jftuga jftuga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comments.

@jftuga jftuga merged commit 4e78f72 into main Nov 16, 2024
@jftuga jftuga deleted the enhancements branch November 16, 2024 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants