Skip to content

Only show separator if command has usage text#2247

Merged
dearchap merged 2 commits intourfave:mainfrom
mikecluck:remove-redundant-separator
Jan 18, 2026
Merged

Only show separator if command has usage text#2247
dearchap merged 2 commits intourfave:mainfrom
mikecluck:remove-redundant-separator

Conversation

@mikecluck
Copy link
Contributor

@mikecluck mikecluck commented Jan 14, 2026

What type of PR is this?

(REQUIRED)

  • bug

What this PR does / why we need it:

(REQUIRED)

  • help.go was changed so that if a command does not have usage information, it will not show a separator

When getting completions for commands, I was getting some confusing output:

$ wizard <tab>
bags     potions  spells   wands  --

To me, it looked like there should be a command named --. After adding usage to a couple of them, I realized what was going on

$ wizard <tab>
bags             -- Bags for holding things                                                                                                                                                                                                                                                         
potions  spells  --                                                                                                                                                                                                                                                                                 
wands            -- Tools for wielding magic   

Which still looks weird. The ones without any usage still get a -- separator. My change ensures that the -- is only shown if there is associated usage information.

$ wizard <tab>
bags     potions  spells   wands

$ wizard <tab>
bags     -- Bags for holding things
wands    -- Tools for wielding magic
potions  spells

Which issue(s) this PR fixes:

(REQUIRED)

N/A

Release Notes

(REQUIRED)

Removed redundant separator in shell completions

@mikecluck mikecluck requested a review from a team as a code owner January 14, 2026 16:15
Copy link
Contributor

@dearchap dearchap left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @mikecluck

@dearchap dearchap merged commit fa7e0b1 into urfave:main Jan 18, 2026
9 checks passed
radermacher-iits pushed a commit to kubara-io/kubara that referenced this pull request Feb 19, 2026
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [github.com/urfave/cli/v3](https://github.com/urfave/cli) | require | patch | `v3.6.1` → `v3.6.2` |

---

### Release Notes

<details>
<summary>urfave/cli (github.com/urfave/cli/v3)</summary>

### [`v3.6.2`](https://github.com/urfave/cli/releases/tag/v3.6.2)

[Compare Source](urfave/cli@v3.6.1...v3.6.2)

#### What's Changed

- chore(deps): bump actions/checkout from 5 to 6 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2230](urfave/cli#2230)
- chore(deps): bump mkdocs-material from 9.6.23 to 9.7.0 in the python-packages group by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2231](urfave/cli#2231)
- Improve test coverage by [@&#8203;dearchap](https://github.com/dearchap) in [#&#8203;2236](urfave/cli#2236)
- Add more tests to improve code coverage by [@&#8203;dearchap](https://github.com/dearchap) in [#&#8203;2237](urfave/cli#2237)
- Fix:(issue\_2238) Dont process flags for completion command by [@&#8203;dearchap](https://github.com/dearchap) in [#&#8203;2239](urfave/cli#2239)
- Fix:(issue\_2228) Fix for default command by [@&#8203;dearchap](https://github.com/dearchap) in [#&#8203;2232](urfave/cli#2232)
- chore(deps): bump mkdocs-material from 9.7.0 to 9.7.1 in the python-packages group by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2242](urfave/cli#2242)
- Docs: correct typo in migration guide by [@&#8203;kzygmans](https://github.com/kzygmans) in [#&#8203;2243](urfave/cli#2243)
- Fix:(issue\_2244) Dont check req flags for help and completion commands by [@&#8203;dearchap](https://github.com/dearchap) in [#&#8203;2245](urfave/cli#2245)
- Only show separator if command has usage text by [@&#8203;mikecluck](https://github.com/mikecluck) in [#&#8203;2247](urfave/cli#2247)

#### New Contributors

- [@&#8203;kzygmans](https://github.com/kzygmans) made their first contribution in [#&#8203;2243](urfave/cli#2243)
- [@&#8203;mikecluck](https://github.com/mikecluck) made their first contribution in [#&#8203;2247](urfave/cli#2247)

**Full Changelog**: <urfave/cli@v3.6.1...v3.6.2>

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0Mi44NC4yIiwidXBkYXRlZEluVmVyIjoiNDIuODQuMiIsInRhcmdldEJyYW5jaCI6Im1hc3RlciIsImxhYmVscyI6W119-->

Reviewed-on: https://kubara.git.onstackit.cloud/STACKIT/kubara/pulls/243
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants