Documentation
¶
Overview ¶
Package common provides shared helpers for keepass CLI commands.
Index ¶
- Constants
- func IsInteractive(in io.Reader) bool
- func IsNonInteractive(cmd *cobra.Command) bool
- func LoadManager() (*manager.Manager, error)
- func LoadOrCreateManager() (*manager.Manager, error)
- func MapError(err error) error
- func NewPrompter(in io.Reader, out io.Writer) *prompt.Prompter
- func ParseTags(input string) []string
- func PrintAuditJSON(w io.Writer, report audit.Report) error
- func PrintAuditText(w io.Writer, report audit.Report) (int, error)
- func PrintConfig(w io.Writer, env home.Environment, cfg configs.Config, initialized bool) error
- func PrintConfigText(w io.Writer, env home.Environment, cfg configs.Config, initialized bool) (int, error)
- func PrintCredentialAuditJSON(w io.Writer, report credentialaudit.Report) error
- func PrintCredentialAuditText(w io.Writer, report credentialaudit.Report) (int, error)
- func PrintEntries(w io.Writer, entries []vault.Entry)
- func PrintEntriesJSON(w io.Writer, entries []vault.Entry) error
- func PrintEntry(w io.Writer, entry vault.Entry, reveal bool)
- func PrintEntryJSON(w io.Writer, entry vault.Entry, reveal bool) error
- func PromptMasterPassword(p *prompt.Prompter) (string, error)
- func PromptNewMasterPassword(p *prompt.Prompter) (string, error)
- func UsageError(message string) error
- func WithExitCode(code int, err error) error
- type CLIError
Examples ¶
Constants ¶
View Source
const ( ExitCodeGeneric = 1 ExitCodeUsage = 2 ExitCodeNotInitialized = 3 ExitCodeUnlockFailed = 4 )
Variables ¶
This section is empty.
Functions ¶
func IsInteractive ¶
func IsNonInteractive ¶
func LoadManager ¶
func LoadOrCreateManager ¶
func ParseTags ¶
Example ¶
package main
import (
"fmt"
"github.com/photowey/keepass/cmd/cmder/common"
)
func main() {
fmt.Println(common.ParseTags(" code, ops , , prod "))
}
Output: [code ops prod]
func PrintConfig ¶
func PrintConfigText ¶
func PrintCredentialAuditJSON ¶
func PrintCredentialAuditJSON(w io.Writer, report credentialaudit.Report) error
func UsageError ¶
func WithExitCode ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.