diff --git a/Cargo.toml b/Cargo.toml index 80f5f32..00a262d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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"] } diff --git a/zung_mini/Cargo.toml b/zung_mini/Cargo.toml index c1196f8..4cbadb6 100644 --- a/zung_mini/Cargo.toml +++ b/zung_mini/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "zung_mini" -version = "0.2.0" +version = "0.2.1" edition = "2021" authors = ["Ishaan Goel "] description = "Mini rust projects that target specific features of rust" diff --git a/zung_mini/src/lib.rs b/zung_mini/src/lib.rs index d780862..b37f718 100644 --- a/zung_mini/src/lib.rs +++ b/zung_mini/src/lib.rs @@ -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, }, diff --git a/zung_mini/src/progbar/mod.rs b/zung_mini/src/progbar/mod.rs index 18b28a5..1ba19f1 100644 --- a/zung_mini/src/progbar/mod.rs +++ b/zung_mini/src/progbar/mod.rs @@ -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