feat: POC passgen
This commit is contained in:
parent
881ccfd820
commit
a78bb9123a
24
cli/app.go
24
cli/app.go
@ -1,6 +1,11 @@
|
|||||||
package cli
|
package cli
|
||||||
|
|
||||||
import "github.com/urfave/cli/v2"
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
|
"github.com/schultz-is/passgen"
|
||||||
|
"github.com/urfave/cli/v2"
|
||||||
|
)
|
||||||
|
|
||||||
var appNewCommand = &cli.Command{
|
var appNewCommand = &cli.Command{
|
||||||
Name: "new",
|
Name: "new",
|
||||||
@ -79,6 +84,23 @@ var appRollbackCommand = &cli.Command{
|
|||||||
var appSecretCommand = &cli.Command{
|
var appSecretCommand = &cli.Command{
|
||||||
Name: "secret",
|
Name: "secret",
|
||||||
Flags: []cli.Flag{AllFlag, PassFlag},
|
Flags: []cli.Flag{AllFlag, PassFlag},
|
||||||
|
Action: func(c *cli.Context) error {
|
||||||
|
passwords, err := passgen.GeneratePassphrases(
|
||||||
|
1,
|
||||||
|
passgen.PassphraseWordCountDefault,
|
||||||
|
rune('-'),
|
||||||
|
passgen.PassphraseCasingDefault,
|
||||||
|
passgen.WordListDefault,
|
||||||
|
)
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, password := range passwords {
|
||||||
|
fmt.Println(password)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
var AppCommand = &cli.Command{
|
var AppCommand = &cli.Command{
|
||||||
|
Reference in New Issue
Block a user