Skip to content
This repository has been archived by the owner on Sep 9, 2022. It is now read-only.

Commit

Permalink
build secman list command in app package
Browse files Browse the repository at this point in the history
  • Loading branch information
abdfnx committed Mar 10, 2022
1 parent d670c9c commit e0c04a4
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions app/list.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package app

import (
"os"
"fmt"

"github.com/spf13/cobra"
tea "github.com/charmbracelet/bubbletea"
"github.com/scmn-dev/secman/pkg/context/lister"
)

func ListCMD() *cobra.Command {
cmd := &cobra.Command{
Use: "list",
Short: "List all passwords.",
Long: "List all passwords in your vault.",
Aliases: []string{"."},
RunE: func(cmd *cobra.Command, args []string) error {
if err := tea.NewProgram(lister.Lister(), tea.WithAltScreen()).Start(); err != nil {
fmt.Printf("could not start program: %s\n", err)
os.Exit(1)
}

return nil
},
}

return cmd
}

0 comments on commit e0c04a4

Please sign in to comment.