forked from toolshed/abra
refactor: break up cli pkg into nice small chunks
This commit is contained in:
25
cli/app/secret.go
Normal file
25
cli/app/secret.go
Normal file
@ -0,0 +1,25 @@
|
||||
package app
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"coopcloud.tech/abra/cli/internal"
|
||||
"coopcloud.tech/abra/secret"
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
// TODO: Replicating what the bash abra does might be hard
|
||||
// with the mix of subcommands and flags
|
||||
var appSecretCommand = &cli.Command{
|
||||
Name: "secret",
|
||||
Flags: []cli.Flag{internal.AllFlag, internal.PassFlag},
|
||||
Action: func(c *cli.Context) error {
|
||||
password, err := secret.GeneratePassphrases(1)
|
||||
if err != nil {
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
fmt.Println(password)
|
||||
return nil
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user