https://github.com/hellerve/progress
A simple CLI progress bar for zepto
https://github.com/hellerve/progress
Last synced: 3 months ago
JSON representation
A simple CLI progress bar for zepto
- Host: GitHub
- URL: https://github.com/hellerve/progress
- Owner: hellerve
- Created: 2016-06-24T16:49:47.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-08-30T14:43:45.000Z (almost 10 years ago)
- Last Synced: 2025-04-05T22:43:44.296Z (about 1 year ago)
- Size: 3.91 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# progress
A simple progress bar widget for the command line in zepto.
# Installation
```
zeps install hellerve/progress
```
# Example Output
```
[### ] 6% (31/500) Elapsed Time: 00:00:04 ETA: 00:01:02
```
# Usage
You can either build a progress bar yourself (using `make-progress-bar`) or
create a context in which it will run (using `with-progress-bar`).
```clojure
(define my-progress (make-progress-bar 100)) ; 100 is the total size of elements, step size will be 10
(define my-progress (make-progress-bar 100 :step 1)) ; the same as above, but the step size will be 1
(define bar (make-progress-bar 200 :step 10 :fill "=" :free "-")) ; the fully configured version
(update-progress-bar my-progress 10) ; 10 elements have ben processed
(with-progress-bar :as my-progress :to 100 :step 10 ; the same as above, but creating a context
(for 101 ((update-progress-bar my-progress i) (system "sleep" ["0.1"]))) ; we are using the implicit loop counter i that is provided by the for macro
(write "Done!")
(exit 0))
```
Have fun!