Skip to content

Fix to use spf13/pflag instead of flag - #94

Open
5ouma wants to merge 2 commits into
stefanlogue:mainfrom
5ouma:fix-internal-flag
Open

Fix to use spf13/pflag instead of flag#94
5ouma wants to merge 2 commits into
stefanlogue:mainfrom
5ouma:fix-internal-flag

Conversation

@5ouma

@5ouma 5ouma commented Apr 22, 2026

Copy link
Copy Markdown
Contributor

The official flag package were used in a util package accidentally on refactoring.

fix: #93

5ouma added 2 commits April 22, 2026 21:33
The official flag package doesn't match the project's flag detection.
Verify only flags that passed are recognized.
Copilot AI review requested due to automatic review settings April 22, 2026 12:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a CLI flag detection bug by ensuring the utility helper uses github.com/spf13/pflag (matching the rest of the app) rather than Go’s stdlib flag, resolving the mismatch described in issue #93.

Changes:

  • Switch internal/util.IsFlagPassed from stdlib flag to spf13/pflag.
  • Update IsFlagPassed tests to use pflag and to explicitly set up flag.CommandLine per subtest.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
internal/util/isFlagPassed.go Aligns flag inspection with spf13/pflag used by the CLI, fixing missed-flag detection.
internal/util/isFlagPassed_test.go Reworks tests to use pflag and validate both passed and non-passed cases by configuring a test flagset.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

Git editor mode fails because passed flags are not detected

2 participants