From bd9012541f91d718efd4514f984186532bf22802 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20M=2E=20Taveras?= Date: Fri, 19 Apr 2024 01:25:29 -0400 Subject: [PATCH] plugins/progress: Add documentation --- plugins/progress/README.md | 47 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 plugins/progress/README.md diff --git a/plugins/progress/README.md b/plugins/progress/README.md new file mode 100644 index 0000000..c2100da --- /dev/null +++ b/plugins/progress/README.md @@ -0,0 +1,47 @@ +### Using the Progress Bar Script + +#### Description + +This script provides a simple progress bar TUI for the terminal platform. It allows you to visualize the progress of a task being executed in your shell script. + +#### Usage + +1. **Copy Functions:** + + - Copy the `delay` and `progress` functions directly into your shell script. + +2. **Invoke `progress` Function:** + - Call the `progress` function within your script to display the progress bar. + +#### Steps + +1. **Copy Functions:** + + - Copy the `delay` and `progress` functions from the script provided into your own shell script. These functions handle the delay and printing of the progress bar. + +2. **Invoke `progress` Function:** + + - Within your script, call the `progress` function whenever you want to display the progress bar. + - Pass two parameters to the `progress` function: + - `PARAM_PROGRESS`: The progress percentage (0-100) of the task. + - `PARAM_STATUS`: Optional. A status message to display alongside the progress bar. + + ```bash + # Example usage: + progress 25 "Processing data..." # Displays a 25% progress bar with the status "Processing data..." + ``` + +#### Example + +```bash +#!/bin/bash + +# Copy the delay and progress functions here + +# Your script logic here +# Invoke the progress function to display the progress bar as your script progresses +# Example: +progress 25 "Processing data..." # Display a 25% progress bar with the status "Processing data..." +``` + +This will visually represent the progress of your script's execution in the terminal. Adjust the `progress` function calls according to the progress of your task.