osc94

Crates.ioosc94
lib.rsosc94
version0.1.1
created_at2025-04-20 12:19:34.496512+00
updated_at2025-04-21 14:52:11.306477+00
descriptionLibrary for handling progress bar sequences (OSC 9;4).
homepage
repositoryhttps://github.com/PRO-2684/osc94
max_upload_size
id1641667
size16,894
PRO (PRO-2684)

documentation

README

osc94

GitHub License GitHub Workflow Status GitHub Release GitHub Downloads (all assets, all releases) Crates.io Version Crates.io Total Downloads docs.rs

Library for handling progress bar sequences (OSC 9;4).

💡 Example

use osc94::Progress;
use std::io::Result;

# fn work() {}
#
fn main() -> Result<()> {
    let mut progress = Progress::default();
    progress.start();

    for i in 0..=100 {
        work();
        progress.increment(1).flush()?;
    }

    Ok(())
}

See more examples in the examples directory.

📖 Usage

Usually, you'll only need the [Progress] struct, which provides a high-level interface and handles clean up job for you when dropped. If you need finer control, you can use the [OSC94] struct and [ProgressState] enum. See the documentation of respective API for more details.

📥 Binary

The provided binary allows you to play with progress bar sequences:

$ osc94
Sets the progress state and value of the progress bar for 1 second.

Usage: osc94 <state> <progress>

States:
  0/hidden
  1/normal
  2/error
  3/indeterminate
  4/warning

Progress: 0-100

It can be installed via the following methods:

Using binstall

cargo binstall osc94

Downloading from Releases

Navigate to the Releases page and download respective binary for your platform. Make sure to give it execute permissions.

Compiling from Source

cargo install osc94

🎉 Credits

Commit count: 11

cargo fmt