gopass: Index | Files

package cui

import ""


Package Files

actions.go cui.go recipients.go


var (
    // Stdin is exported for tests
    Stdin io.Reader = os.Stdin
    // Stdout is exported for tests
    Stdout io.Writer = os.Stdout
    // Stderr is exported for tests
    Stderr io.Writer = os.Stderr

func AskForGitConfigUser Uses

func AskForGitConfigUser(ctx context.Context, crypto backend.Crypto, name string) (string, string, error)

AskForGitConfigUser will iterate over GPG private key identities and prompt the user for selecting one identity whose name and email address will be used as git config and git config, respectively. On error or no selection, name and email will be empty. If s.isTerm is false (i.e., the user cannot be prompted), however, the first identity's name/email pair found is returned.

func AskForPrivateKey Uses

func AskForPrivateKey(ctx context.Context, crypto backend.Crypto, name, prompt string) (string, error)

AskForPrivateKey promts the user to select from a list of private keys

func AskForStore Uses

func AskForStore(ctx context.Context, s mountPointer) string

AskForStore shows a store / mount point selection

func ConfirmRecipients Uses

func ConfirmRecipients(ctx context.Context, crypto backend.Crypto, name string, recipients []string) ([]string, error)

ConfirmRecipients asks the user to confirm a given set of recipients

func GetSelection Uses

func GetSelection(ctx context.Context, prompt, usage string, choices []string) (string, int)

GetSelection show a navigateable multiple-choice list to the user and returns the selected entry along with the action

type Action Uses

type Action struct {
    Name string
    Fn   func(context.Context, *cli.Context) error

Action is a action which can be selected

type Actions Uses

type Actions []Action

Actions is a list of actions

func (Actions) Run Uses

func (ca Actions) Run(ctx context.Context, c *cli.Context, i int) error

Run executes the selected action

func (Actions) Selection Uses

func (ca Actions) Selection() []string

Selection return the list of actions

Package cui imports 21 packages (graph). Updated 2019-08-27. Refresh now. Tools for package owners.