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 omitting unit #36

Merged
merged 2 commits into from
Sep 19, 2022
Merged

Conversation

lucassperez
Copy link
Contributor

Hello and good day. I'm not really sure how to contribute to this project, if I could just open a PR or not, so if this was not OK please let me know and lets close it.

The thing is, I saw an open issue where it was requestes to allow ommiting units, just like the regular sleep command, where it defaults to seconds when no unit is passed. So I did kind of fix to that. I'm not a go programmer, I recently started learning it, so I don't know if my implementation was a good idea or not. I mutated the state of arg[0], this sounds fishy, but I looked like it wasn't used anywhere else.

Anyways, if this is a valid feature (ommiting units), please let me know. And if it is the case, I think it could be stated in the help/manual/readme that it defaults to seconds.

Solves #34

@lucassperez lucassperez changed the title Allow omitting unit #34 Allow omitting unit Sep 17, 2022
@caarlos0
Copy link
Owner

hey, yeah this looks good! thanks

wanna add to the help as well?

@lucassperez
Copy link
Contributor Author

lucassperez commented Sep 19, 2022

I'm not sure how to add the help 😅 But I'd be glad to add it. The actual help message apparently is "timer is like sleep, but with progress report", so I'm not sure how to insert the information about defaulting to seconds, since there is not really a mention to units.

I added a line to the README.md (got the info from the docs), but I also don't know how the man pages are generated, I think it would be nice to mention the default unit as seconds in the man page as well.

@caarlos0
Copy link
Owner

man pages are auto-generated, this looks good, thanks!

@caarlos0 caarlos0 merged commit 880f473 into caarlos0:main Sep 19, 2022
@caarlos0 caarlos0 mentioned this pull request Sep 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants