refactor: break up cli pkg into nice small chunks

This commit is contained in:
2021-08-02 02:10:41 +01:00
parent c2f53e493e
commit 30d11f48a7
29 changed files with 787 additions and 649 deletions

25
cli/app/secret.go Normal file
View 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
},
}