[PR #147] [MERGED] Beautify help messages #326

Closed
opened 2026-06-08 11:27:10 +03:00 by zhus · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/bootandy/dust/pull/147
Author: @QuarticCat
Created: 6/5/2021
Status: Merged
Merged: 6/8/2021
Merged by: @bootandy

Base: masterHead: master


📝 Commits (3)

  • 15a8676 Add wrap_help feature to clap
  • 551c5d3 Simplify conflict implementation
  • e1ffc92 Merge branch 'master' into master

📊 Changes

3 files changed (+19 additions, -12 deletions)

View changed files

📝 Cargo.lock (+12 -0)
📝 Cargo.toml (+5 -6)
📝 src/main.rs (+2 -6)

📄 Description

Before:

image

After:

image

If you add AppSettings::ColoredHelp, the output can be better:

image

However, currently this cannot work with your --no-colors flag. See
https://github.com/clap-rs/clap/issues/1880 and https://github.com/clap-rs/clap/issues/1185.

Actually, this not only affects help messages, but also affects error output of clap. (BTW, your current error handling is not consistent with clap's built-in. If you want a more consistent error output, you can check clap::Error. But that will also introduce some problems.)

One compromise is to use NO_COLOR environment variable to disable colors. If you like that, I can commit relative codes.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/bootandy/dust/pull/147 **Author:** [@QuarticCat](https://github.com/QuarticCat) **Created:** 6/5/2021 **Status:** ✅ Merged **Merged:** 6/8/2021 **Merged by:** [@bootandy](https://github.com/bootandy) **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (3) - [`15a8676`](https://github.com/bootandy/dust/commit/15a867636f5aa60dfaf2497082a15a538eec455f) Add wrap_help feature to clap - [`551c5d3`](https://github.com/bootandy/dust/commit/551c5d3bfa279da206805d31c95d56ec1bf425d1) Simplify conflict implementation - [`e1ffc92`](https://github.com/bootandy/dust/commit/e1ffc925891e88e0f556a8676a0c17760532ffef) Merge branch 'master' into master ### 📊 Changes **3 files changed** (+19 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `Cargo.lock` (+12 -0) 📝 `Cargo.toml` (+5 -6) 📝 `src/main.rs` (+2 -6) </details> ### 📄 Description Before: ![image](https://user-images.githubusercontent.com/70888415/120892799-8d8e8180-c642-11eb-924b-c8e8127a89b4.png) After: ![image](https://user-images.githubusercontent.com/70888415/120892809-9717e980-c642-11eb-819b-e6c38adafac4.png) If you add `AppSettings::ColoredHelp`, the output can be better: ![image](https://user-images.githubusercontent.com/70888415/120892849-bd3d8980-c642-11eb-9d08-fab8127cc013.png) However, currently this cannot work with your `--no-colors` flag. See https://github.com/clap-rs/clap/issues/1880 and https://github.com/clap-rs/clap/issues/1185. Actually, this not only affects help messages, but also affects error output of clap. (BTW, your current error handling is not consistent with clap's built-in. If you want a more consistent error output, you can check [clap::Error](https://docs.rs/clap/2.33.3/clap/struct.Error.html). But that will also introduce [some problems](https://github.com/ducaale/xh/pull/151#issuecomment-855223285).) One compromise is to use `NO_COLOR` environment variable to disable colors. If you like that, I can commit relative codes. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
zhus added the pull-request label 2026-06-08 11:27:10 +03:00
zhus closed this issue 2026-06-08 11:27:11 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: bootandy/archived-dust#326