samwho / spacer

CLI tool to insert spacers when command output stops
https://github.com/samwho/spacer
MIT License
853 stars 9 forks source link

Timezone Selection #16

Closed simonwiles closed 11 months ago

simonwiles commented 11 months ago

Okay, here's a (tested) implementation of a --timezone argument that accepts IANA timezone names in the America/Los_Angeles style. Here it is running on a server in Germany:

$ while true; do date; sleep 2; done | spacer --timezone America/Los_Angeles
Wed 13 Sep 21:02:40 CEST 2023
2023-09-13 12:02:41 PDT 1.0s ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Wed 13 Sep 21:02:42 CEST 2023
2023-09-13 12:02:43 PDT 2.0s ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Wed 13 Sep 21:02:44 CEST 2023
2023-09-13 12:02:45 PDT 2.0s ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Wed 13 Sep 21:02:46 CEST 2023
2023-09-13 12:02:47 PDT 2.0s ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
...

Submitted for your consideration.

Closes #12.

samwho commented 11 months ago

Just the one small change requested. Thank you for your contributions to spacer! 🙏

simonwiles commented 11 months ago

Thank you! This small change makes this super-useful little tool even more chef's kiss for me 🙂