26 lines
542 B
Go
26 lines
542 B
Go
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
|
|
},
|
|
}
|