GitHub - agens-no/swiff: Human readable time diffs on lines of output when runni...
source link: https://github.com/agens-no/swiff
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
README.md
swiff
Why not let the computer do all that diffing of time stamps you tend do manually?
? Usage
Live with any command
command | swiff
Try it out
while true; do echo "Foo"; sleep $[ ($RANDOM % 3) + 1 ]s; done | swiff
With fastlane
fastlane build | swiff --fastlane
Or even shorter
fastlane build | swiff -f
Or maybe you have an old build log from fastlane?
cat build.log | swiff -f
? Example output
Summary
Useful summmary at the end with most important highlights
✌️ Install
Globally by oneliner
git clone [email protected]:agens-no/swiff.git && cd swiff && make && cd .. && rm -rf swiff/
You may now type swiff help
from any directory in terminal to verify that the install is complete
- Uses git to clone
swiff
to a directoryswiff
in your current directory - moves in to the created
swiff
folder - builds swift using the Makefile (basically compiling main.swift and installing
swiff
at/usr/local/bin/swiff
) - moves back out of the folder
- deletes the
swiff
folder
Globally by cloning
git clone [email protected]:agens-no/swiff.git cd swiff make
You may now type swiff help
from any directory in terminal to verify that the install is complete
Locally by onliner
curl --fail https://raw.githubusercontent.com/agens-no/swiff/master/main.swift > swiff.swift && swiftc -o swiff swiff.swift && rm swiff.swift
You may now type ./swiff help
from your current directory and use it like fastlane build | ./swiff -f
- Uses curl to copy
main.swift
to a file calledswiff.swift
in your current directory - builds using your current swift tooling
- deletes swiff.swift
Installation issues?
Might be because of requirements: swift 4, Xcode, macOS
Open an issue and let me know!
✊ Advanced usage
Usage: swiff [-l low] [-m medium] [-h high] [-r reset-mark] [-d diff-mode] [-s summary-limit] [-f --fastlane]
-l, --low Threshold in seconds for low duration color formatting (default: 1)
-m, --medium Threshold in seconds for medium duration color formatting (default: 5)
-h, --high Threshold in seconds for high duration color formatting (default: 10)
-r, --reset-mark String match to reset total counter (default: none)
-d, --diff-mode Valid options is "live" or "fastlane (default: live)
-s, --summary-limit Maximum number of lines in summary (default: 20)
-f, --fastlane Shortcut for --diff-mode fastlane --reset-mark "Step :"
Example: cat build.log | swiff --low 1 --medium 5 --high 10 --reset-mark "Step: " --diff-mode live --summary-limit 20
Example: fastlane build | swiff -f
? License
MIT
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK