feat: POC passgen
This commit is contained in:
		
							
								
								
									
										24
									
								
								cli/app.go
									
									
									
									
									
								
							
							
						
						
									
										24
									
								
								cli/app.go
									
									
									
									
									
								
							@ -1,6 +1,11 @@
 | 
			
		||||
package cli
 | 
			
		||||
 | 
			
		||||
import "github.com/urfave/cli/v2"
 | 
			
		||||
import (
 | 
			
		||||
	"fmt"
 | 
			
		||||
 | 
			
		||||
	"github.com/schultz-is/passgen"
 | 
			
		||||
	"github.com/urfave/cli/v2"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
var appNewCommand = &cli.Command{
 | 
			
		||||
	Name: "new",
 | 
			
		||||
@ -79,6 +84,23 @@ var appRollbackCommand = &cli.Command{
 | 
			
		||||
var appSecretCommand = &cli.Command{
 | 
			
		||||
	Name:  "secret",
 | 
			
		||||
	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{
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user