Skip to content

Jomy10/TaskProgress

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Task Progress

documentation


Show progress of multiple tasks in the terminal

example gif

Important

Library in early development, feedback is appreciated, expect bugs

Example

ProgressIndicators.global.show()

let main = SpinnerProgressTask("Building module Main")
main.setMessage("waiting on Logging")
ProgressIndicators.global.addTask(main)

Task {
  try await Task.sleep(for: .seconds(1))
  let loggingTask = ProgressBarTask("Building module Logging", total: 100)
  ProgressIndicators.global.addTask(loggingTask)
  for _ in 0..<100 {
    loggingTask.progress()
    try await Task.sleep(for: .seconds(0.1))
  }
  main.finish()
}

You can run this example by cloning this repository and running swift run.

TODO

  • for ansi output: when terminal height is less than what is being outputted, then only print for available height, only at the end, print everything

About

Progress indicators for multiple tasks in the terminal

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages