Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Waqar144/progressbar
An easy to use V library for creating progress bar
https://github.com/Waqar144/progressbar
command-line-tool v
Last synced: 3 months ago
JSON representation
An easy to use V library for creating progress bar
- Host: GitHub
- URL: https://github.com/Waqar144/progressbar
- Owner: Waqar144
- License: mit
- Created: 2019-11-06T15:58:09.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-03-14T17:20:43.000Z (over 1 year ago)
- Last Synced: 2024-04-24T16:56:01.102Z (7 months ago)
- Topics: command-line-tool, v
- Language: V
- Size: 50.8 KB
- Stars: 29
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-v - progressbar - An easy to use V library for creating progress bars in cli. (Libraries / Command line interface (CLI) / Terminal / Shell)
README
## Intro
Progress bar is a small module written in [vlang](https://github.com/vlang/v) to create progress bar on cli. It's a port of [doches/progressbar](https://github.com/doches/progressbar). It aims to provide complete functionality of the original project.
Currently only progress bar has been implemented and nothing is being exported.
![](screenshots/screenshot.png)
## Usage
### Statusbar
```
import statusbar
fn main() {
s := statusbar.new_statusbar('Label')
go s.start()
//logic..
s.finish()
}
```### Progressbar
`demo.v` gives an overview of how to use this module.
Example:
```
import progressbarfn main() {
p := progressbar.Progressbar{}
steps := 50
p.new('Label', steps)
for i := 0; i < steps; i++ {
// logic...
p.increment()
}
}
//when you are done call finsih()
p.finish()
```
You can pass in your own style using `new_with_format(label string, max int, format []byte]` instead of `new()`:
```
p.new_with_format('Your Label', num_steps, [`O`,`.`,`O`]
```
Output:
```
Your Label O...................O ETA0h0m0s
```## Building
First clone the repo
```
https://github.com/Waqar144/progressbar.git
```Then
```
cd progressbar
v build progressbar.v
```
Or if you want to build it as a module
```
v build module ~/path/to/dir/progressbar
//to build the stausbar module
v build module ~/path/to/dir/statusbar
```
### Running the demo
```
v run demo.v
```## Contributing
Feel free to clone and contribute. All contributions are welcome.## License
MIT