cli

package
v1.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 11, 2021 License: GPL-3.0 Imports: 23 Imported by: 0

Documentation

Overview

Package cli implements the gopass CLI.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, cfg CommandConfig, cmdAndArgs []string) error

Run parses the arguments and executes the gopass CLI

Types

type CommandConfig

type CommandConfig interface {
	WriterOutput() io.Writer
	WriterError() io.Writer
	ReaderInput() io.Reader
	Editor() string
	PasswordStoreDir() string
	PasswordStore() *store.PasswordStore
}

CommandConfig contains everything that commands needs to run.

func NewCommandConfig

func NewCommandConfig(writerOutput, writerError io.Writer, readerInput io.Reader) CommandConfig

NewCommandConfig creates a CommandConfig.

type DefaultConfig

type DefaultConfig struct {
	// contains filtered or unexported fields
}

DefaultConfig is a default CommandConfig implementation.

func (*DefaultConfig) Editor

func (cfg *DefaultConfig) Editor() string

Editor returns the configured editor.

func (*DefaultConfig) PasswordStore

func (cfg *DefaultConfig) PasswordStore() *store.PasswordStore

PasswordStore returns the PasswordStore.

func (*DefaultConfig) PasswordStoreDir

func (cfg *DefaultConfig) PasswordStoreDir() string

PasswordStoreDir returns the password store directory.

func (*DefaultConfig) ReaderInput

func (cfg *DefaultConfig) ReaderInput() io.Reader

ReaderInput returns the input reader

func (*DefaultConfig) WriterError

func (cfg *DefaultConfig) WriterError() io.Writer

WriterError returns the output writer

func (*DefaultConfig) WriterOutput

func (cfg *DefaultConfig) WriterOutput() io.Writer

WriterOutput returns the output writer

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL