Skip to content

Conversation

@dearchap
Copy link
Contributor

What type of PR is this?

(REQUIRED)

  • cleanup

What this PR does / why we need it:

(REQUIRED)

The behaviour of GetDefaultText was too unpredictable, depending on whether the DefaultText is set or whether Value is set and what not. This change takes the guesswork out of flag_impl.go and puts the logic into docs.go where it should be

Which issue(s) this PR fixes:

(REQUIRED)

Special notes for your reviewer:

(fill-in or delete this section)

Testing

(fill-in or delete this section)

make test

Release Notes

(REQUIRED)

flag.GetDefaultText returns the DefaultText set by the user without any modification

@dearchap dearchap requested a review from a team as a code owner October 21, 2025 00:45
@dearchap dearchap merged commit 495e1d3 into urfave:main Oct 21, 2025
9 checks passed
@oprudkyi
Copy link
Contributor

Hi @dearchap ,

related to

		{
			name:     "bool-flag",
			fl:       &BoolFlag{Name: "vividly"},
-			expected: "--vividly\t(default: false)",
+			expected: "--vividly\t",
		},

since HideDefault is false by default then in this case it should show default value in this test

saschazepter pushed a commit to saschazepter/forgejo that referenced this pull request Oct 23, 2025
This PR contains the following updates:

| Package | Change | Age | Confidence |
|---|---|---|---|
| [github.com/urfave/cli/v3](https://github.com/urfave/cli) | `v3.4.1` -> `v3.5.0` | [![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2furfave%2fcli%2fv3/v3.5.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2furfave%2fcli%2fv3/v3.4.1/v3.5.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

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

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

[Compare Source](urfave/cli@v3.4.1...v3.5.0)

#### What's Changed

- Update mkdocs reqs by [@&#8203;meatballhat](https://github.com/meatballhat) in [#&#8203;2190](urfave/cli#2190)
- Allow the user to stop processing flags after seeing N args by [@&#8203;adrian-thurston](https://github.com/adrian-thurston) in [#&#8203;2163](urfave/cli#2163)
- chore(deps): bump github.com/stretchr/testify from 1.10.0 to 1.11.0 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2194](urfave/cli#2194)
- chore(deps): bump mkdocs-material from 9.6.16 to 9.6.18 in the python-packages group by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2195](urfave/cli#2195)
- chore(deps): bump actions/setup-go from 5 to 6 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2198](urfave/cli#2198)
- chore(deps): bump actions/setup-node from 4 to 5 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2199](urfave/cli#2199)
- chore(deps): bump actions/setup-python from 5 to 6 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2200](urfave/cli#2200)
- chore(deps): bump github.com/stretchr/testify from 1.11.0 to 1.11.1 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2197](urfave/cli#2197)
- chore(deps): bump mkdocs-material from 9.6.18 to 9.6.19 in the python-packages group by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2201](urfave/cli#2201)
- chore(deps): bump mkdocs-material from 9.6.19 to 9.6.20 in the python-packages group by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2202](urfave/cli#2202)
- feat: add name of argument into error message when parsing fails by [@&#8203;oprudkyi](https://github.com/oprudkyi) in [#&#8203;2203](urfave/cli#2203)
- chore(deps): bump mkdocs-material from 9.6.20 to 9.6.21 in the python-packages group by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2204](urfave/cli#2204)
- add space between arguments usage by [@&#8203;dimfu](https://github.com/dimfu) in [#&#8203;2207](urfave/cli#2207)
- chore(deps): bump mkdocs-material from 9.6.21 to 9.6.22 in the python-packages group by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2213](urfave/cli#2213)
- Fix: Make DefaultText behaviour consistent by [@&#8203;dearchap](https://github.com/dearchap) in [#&#8203;2214](urfave/cli#2214)

#### New Contributors

- [@&#8203;adrian-thurston](https://github.com/adrian-thurston) made their first contribution in [#&#8203;2163](urfave/cli#2163)
- [@&#8203;oprudkyi](https://github.com/oprudkyi) made their first contribution in [#&#8203;2203](urfave/cli#2203)
- [@&#8203;dimfu](https://github.com/dimfu) made their first contribution in [#&#8203;2207](urfave/cli#2207)

**Full Changelog**: <urfave/cli@v3.4.1...v3.5.0>

</details>

---

### Configuration

📅 **Schedule**: Branch creation - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC), Automerge - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC).

🚦 **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:eyJjcmVhdGVkSW5WZXIiOiI0MS4xNTIuOSIsInVwZGF0ZWRJblZlciI6IjQxLjE1Mi45IiwidGFyZ2V0QnJhbmNoIjoiZm9yZ2VqbyIsImxhYmVscyI6WyJkZXBlbmRlbmN5LXVwZ3JhZGUiLCJ0ZXN0L25vdC1uZWVkZWQiXX0=-->

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9818
Reviewed-by: Earl Warren <[email protected]>
Co-authored-by: Renovate Bot <[email protected]>
Co-committed-by: Renovate Bot <[email protected]>
@dearchap
Copy link
Contributor Author

@oprudkyi I think it doesnt make sense for bool flags to have default texts since they are false by default no ?

@oprudkyi
Copy link
Contributor

@dearchap yes, sure. Sorry

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.

3 participants