chore: migrate from stdlib flag to pflag for POSIX-style double-dash …#6
Merged
krakenhavoc merged 1 commit intomainfrom Apr 13, 2026
Merged
chore: migrate from stdlib flag to pflag for POSIX-style double-dash …#6krakenhavoc merged 1 commit intomainfrom
krakenhavoc merged 1 commit intomainfrom
Conversation
…flags Replace Go's standard library flag package with spf13/pflag so all subcommand flags use the conventional --double-dash syntax instead of single-dash. This aligns the CLI with POSIX/GNU conventions used by tools like gh, docker, and kubectl.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request updates the flag parsing library in the
krakenkeyCLI from the standardflagpackage togithub.com/spf13/pflag, which is more flexible and POSIX-compliant. The main logic and behavior remain the same, but several custom flag types are updated for compatibility, and global flag handling is improved.Dependency update:
github.com/spf13/pflagas a dependency ingo.modto replace the standardflagpackage.Flag parsing migration:
cmd/krakenkey/main.gofrom the standardflagpackage topflag, including updating the import and all usages.SetInterspersed(false)on the global flag set to prevent interleaved flags and arguments, matching previous CLI behavior.--versionflag to use the newpflagAPI for boolean flags.Custom flag type compatibility:
Type()method to thestringsFlagcustom flag type forpflagcompatibility.Type()method to thetriBoolFlagcustom flag type forpflagcompatibility.Replace Go's standard library flag package with spf13/pflag so all subcommand flags use the conventional --double-dash syntax instead of single-dash. This aligns the CLI with POSIX/GNU conventions used by tools like gh, docker, and kubectl.