Skip to content

fix(deps): require upstream urfave/sflags instead of the patdowney fork - #21

Merged
patdowney merged 1 commit into
masterfrom
fix/sflags-upstream
Nov 4, 2026
Merged

patdowney merged 1 commit into
masterfrom
fix/sflags-upstream

Conversation

@patdowney

Copy link
Copy Markdown
Contributor

Summary

This replaces the patdowney/sflags fork with upstream urfave/sflags, and removes the replace directive.

The fork's only change, the InheritHidden() / InheritDeprecated() options, was merged upstream as urfave/sflags@b88b11ddd16a with the same API. Upstream hasn't tagged a release since v0.4.1, so this requires that commit by pseudo-version:

github.com/urfave/sflags v0.4.2-0.20250718033027-b88b11ddd16a

The pseudo-version sorts above v0.4.1, so consumers get the fix through normal version selection. They no longer have to carry their own replace, which also blocked go install module@latest and let a consumer that forgot it silently build the unpatched version.

Notes

  • Pinned to b88b11d, not main HEAD. HEAD also contains the later strings.SplitN value-splitting change (Use SplitN for map flags to support values containing separators urfave/sflags#45). That should be adopted deliberately rather than as a side effect.
  • New test: TestNewCommand_NestedFlagsInheritParentTags pins the behaviour consumers rely on to keep whole config blocks out of --help: a hidden or deprecated tag on a struct field applies to every flag generated from its fields. Nothing tested this before.
  • Verification: make verify passes with GOWORK=off.

After merge

  1. Tag a dioad/cli release.
  2. In dioad/connect: bump dioad/cli and delete the sflags replace from go.mod.
  3. Optional: once upstream tags v0.4.2, move from the pseudo-version to the tag.

Closes #17

🤖 Generated with Claude Code

https://claude.ai/code/session_01SS4MAynosZMkKwVBuvNmA9

The InheritHidden/InheritDeprecated options the fork added were merged
upstream (urfave/sflags b88b11d) but are not yet in a tagged release.
Require that commit by pseudo-version and drop the replace directive, so
consumers get the fix through normal version selection instead of each
carrying their own replace (which also blocks `go install module@latest`).

Pinned to b88b11d rather than main HEAD to avoid also taking the later
strings.SplitN value-splitting change unreviewed.

Adds a test pinning the nested hidden/deprecated flag inheritance that
consumers rely on to keep config blocks out of --help.

Refs #17

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SS4MAynosZMkKwVBuvNmA9
@patdowney
patdowney merged commit 30af2b1 into master Nov 4, 2026
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.

Remove need for consumer replace directive on urfave/sflags fork

1 participant