Skip to content

Commit

Permalink
Progbar Documentation Fixes (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
ishaan26 authored Oct 1, 2024
2 parents 017dc86 + 72045c0 commit ba0911f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ members = ["zung_mini"]
resolver = "2"

[dependencies]
zung_mini = { version = "0.2.0", path = "./zung_mini" }
zung_mini = { version = "0.2.1", path = "./zung_mini" }
anstyle = "1.0.8"
clap = { version = "4.5.18", features = ["derive"] }
2 changes: 1 addition & 1 deletion zung_mini/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "zung_mini"
version = "0.2.0"
version = "0.2.1"
edition = "2021"
authors = ["Ishaan Goel <[email protected]>"]
description = "Mini rust projects that target specific features of rust"
Expand Down
8 changes: 8 additions & 0 deletions zung_mini/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,28 @@ enum MiniCommands {
#[derive(Clone, Subcommand, Debug)]
#[command(arg_required_else_help = true)]
enum ProgBarCommands {
/// Runs the progbar on an simulated infinite loop.
UnBounded {
/// Custom message to display along with the spinner.
#[arg(short, long, default_value_t = String::from("Simulating Loading..."))]
message: String,
},

/// Runs the progbar on an simulated loop having len of iter_count.
Bounded {
/// Custom starting delimiter for the loading bar.
#[arg(long, default_value_t = String::from("["))]
delim_start: String,

/// Custom ending delimiter for the loading bar.
#[arg( long, default_value_t = String::from("]"))]
delim_close: String,

/// Custom bar style. Each value specified will be repeated on each iteration.
#[arg(long, default_value_t = String::from("#"))]
bar_style: String,

/// Set custom length of the loop.
#[arg(short, long, default_value_t = 50)]
iter_count: u8,
},
Expand Down
2 changes: 1 addition & 1 deletion zung_mini/src/progbar/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
//!
//! The output will look something like this in the terminal as the progress bar updates:
//! ```text
//! #####
//! ⠼ Loading...
//! ```
//!
//! ## Bounded Progress Bar with Custom Delimiters
Expand Down

0 comments on commit ba0911f

Please sign in to comment.