Skip to content

Commit

Permalink
fix xflag.ParseToEnd usage
Browse files Browse the repository at this point in the history
  • Loading branch information
ilius committed Oct 24, 2024
1 parent fe45450 commit 7fb9605
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ func Main(stdout io.Writer, args []string) {
"repassgen [-entropy] PATTERN",
)

err := xflag.ParseToEnd(flagSet, args)
err := xflag.ParseToEnd(flagSet, args[1:])
if err != nil {
os.Stderr.WriteString(err.Error() + "\n")
os.Exit(1)
}

calcEnropy := entropyFlag != nil && *entropyFlag

pattern := flagSet.Arg(1)
pattern := flagSet.Arg(0)
out, _, err := passgen.Generate(passgen.GenerateInput{
Pattern: []rune(pattern),
})
Expand Down

0 comments on commit 7fb9605

Please sign in to comment.