Skip to navigation
Progress/Total and Countdown/Total
23.11.26
In command-line interface (CLI) design, the standard convention is **"Progress/Total"** (e.g., `1/100`, `2/100`). However, when you are **counting down** (e.g., you have 100 tasks remaining and you want to show how many are left), the most intuitive format is **"Remaining/Total"**. Here is the breakdown of the preferred ways to handle this: ### 1. The "Progress" Approach (Most Common) If you are tracking how much work is *done*, use the standard progress format. This is what users expect to see in almost every CLI tool (like `curl`, `wget`, or `apt`). * **Format:** `[Done]/[Total]` * **Example:** `1/100`, `2/100`, `3/100` ... `100/100` * **Why:** It shows the "completion percentage" naturally. ### 2. The "Countdown" Approach If your specific use case is to show how much work is *left* (e.g., "I have 100 items to process, and I'm watching them disappear"), use the "Remaining" format. * **Format:** `[Remaining]/[Total]` * **Example:** `100/100`, `99/100`, `98/100` ... `1/100` * **Why:** It clearly communicates "How much longer until I'm finished?" ### 3. The "Professional" CLI Style (Recommended) If you want your CLI tool to look polished, don't just print lines of text. Use a **Progress Bar** or a **Status Line** that updates in place. In Common Lisp, you can use the `\r` (carriage return) character to move the cursor back to the start of the line so you don't clutter the terminal with 100 lines of text. **Example implementation in Common Lisp:** ```lisp (defun run-tasks (total) (loop for i from total downto 1 do (format t "~&~d/~d tasks remaining... " i total) (finish-output) ;; Important: forces the text to appear immediately (sleep 0.1) ;; Simulate work finally (format t "~&Done!~%"))) ``` ### Which one should you choose? * **If you are building a tool for others:** Use the **Progress** style (`1/100`). It is the universal standard. * **If you are building a tool for yourself/monitoring:** Use the **Countdown** style (`100/100` down to `1/100`). It is very satisfying to watch the number of remaining tasks hit zero. **A quick tip for your CLI:** If you want to make it look really professional, add a percentage: `[98/100] 2% complete` or `[Remaining: 98/100]`.
Reply
Anonymous
Information Epoch 1795523554
Design for simplicity, add complexity only where you must.
Home
Notebook
Contact us