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

Allow negative durations in conv cmd #17

Merged
merged 1 commit into from
Nov 16, 2024
Merged

Allow negative durations in conv cmd #17

merged 1 commit into from
Nov 16, 2024

Conversation

jftuga
Copy link
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

conv.go Outdated Show resolved Hide resolved
Copy link
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
conv.go Show resolved Hide resolved
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