Skip to content

feat: add reverse option#17

Merged
willswire merged 3 commits intowillswire:mainfrom
exurd:reverse-emoji-placement
Feb 4, 2025
Merged

feat: add reverse option#17
willswire merged 3 commits intowillswire:mainfrom
exurd:reverse-emoji-placement

Conversation

@exurd
Copy link
Contributor

@exurd exurd commented Feb 3, 2025

This PR adds an option to reverse the position where the emoji will be placed (to the end of each line).

Examples

Normal behaviour (brew info xz)

==> xz: stable 5.6.4 (bottled)
General-purpose data compression with high compression ratio
https://tukaani.org/xz/
Installed
/opt/homebrew/Cellar/xz/5.6.4 (96 files, 2.0MB) *
  Poured from bottle using the formulae.brew.sh API on 2025-01-31 at 11:14:34
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/x/xz.rb
License: 0BSD AND GPL-2.0-or-later
==> Analytics
install: 276,076 (30 days), 753,478 (90 days), 3,557,894 (365 days)
install-on-request: 72,609 (30 days), 197,061 (90 days), 944,506 (365 days)
build-error: 99 (30 days)

With teemoji (brew info xz | teemoji):

🐍 ==> xz: stable 5.6.4 (bottled)
🔥 General-purpose data compression with high compression ratio
🔗 https://tukaani.org/xz/
✅ Installed
🚧 /opt/homebrew/Cellar/xz/5.6.4 (96 files, 2.0MB) *
✂️   Poured from bottle using the formulae.brew.sh API on 2025-01-31 at 11:14:34
🔗 From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/x/xz.rb
⏳ License: 0BSD AND GPL-2.0-or-later
🔄 ==> Analytics
📈 install: 275,977 (30 days), 753,445 (90 days), 3,557,781 (365 days)
📈 install-on-request: 72,571 (30 days), 197,058 (90 days), 944,466 (365 days)
🚧 build-error: 99 (30 days)

With reversed option enabled (brew info xz | teemoji -r):

==> xz: stable 5.6.4 (bottled) 🐍
General-purpose data compression with high compression ratio 🔥
https://tukaani.org/xz/ 🔗
Installed ✅
/opt/homebrew/Cellar/xz/5.6.4 (96 files, 2.0MB) * 🚧
  Poured from bottle using the formulae.brew.sh API on 2025-01-31 at 11:14:34 ✂️
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/x/xz.rb 🔗
License: 0BSD AND GPL-2.0-or-later ⏳
==> Analytics 🔄
install: 275,977 (30 days), 753,445 (90 days), 3,557,781 (365 days) 📈
install-on-request: 72,571 (30 days), 197,058 (90 days), 944,466 (365 days) 📈
build-error: 99 (30 days) 🚧

Doing brew info xz | teemoji -r | teemoji allows emojis to be on both sides, though it relies on the first teemoji to finish printing:

🐍 ==> xz: stable 5.6.4 (bottled) 🐍
🔥 General-purpose data compression with high compression ratio 🔥
🔗 https://tukaani.org/xz/ 🔗
✅ Installed ✅
🚧 /opt/homebrew/Cellar/xz/5.6.4 (96 files, 2.0MB) * 🚧
✂️   Poured from bottle using the formulae.brew.sh API on 2025-01-31 at 11:14:34 ✂️
🔗 From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/x/xz.rb 🔗
⏳ License: 0BSD AND GPL-2.0-or-later ⏳
🔄 ==> Analytics 🔄
📈 install: 277,072 (30 days), 753,808 (90 days), 3,558,894 (365 days) 📈
📈 install-on-request: 73,035 (30 days), 197,164 (90 days), 944,950 (365 days) 📈
🚧 build-error: 99 (30 days) 🚧

@exurd exurd changed the title Add --reverse option (to add emojis at the end of an output line) feat: --reverse option (to add emojis at the end of an output line) Feb 3, 2025
@willswire willswire changed the title feat: --reverse option (to add emojis at the end of an output line) feat: add reverse option Feb 3, 2025
@willswire
Copy link
Owner

Please add a test for the --reverse option and we'll get this merged!

should be good. unsure on the second part of the test, but since the prediction is always one space apart from the input string, it does work...
@exurd exurd marked this pull request as ready for review February 4, 2025 01:01
@willswire willswire merged commit 28b8a1b into willswire:main Feb 4, 2025
2 checks passed
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