View Source PacmanProgressBar (pacman_progress_bar v0.1.0)
This module creates a progress bar based on Arch Linux's pacman package manager
Link to this section Summary
Functions
Returns the progress bar in the form of a string
Writes the progress bar to the terminal using IO.write/2. Calling this function again will overwrite the last progress bar. If all tasks are completed it will automatically print a newline character
Link to this section Functions
Returns the progress bar in the form of a string
Use PacmanProgressBar.render/2 if you automatically want to write this string to the terminal
examples
Examples
iex> PacmanProgressBar.raw(30, 7)
#=> "[------c-o--o--o--o--o--o--o--] 23%"
Writes the progress bar to the terminal using IO.write/2. Calling this function again will overwrite the last progress bar. If all tasks are completed it will automatically print a newline character
Use PacmanProgressBar.raw/2 to get the progress bar in the form of a string
examples
Examples
iex> PacmanProgressBar.render(30, 7)
#=> [------c-o--o--o--o--o--o--o--] 23%
iex> defmodule Test do
def function do
PacmanProgressBar.render(30, 7)
PacmanProgressBar.render(30, 10)
end
end
#=> [---------C-o--o--o--o--o--o--] 33%