ls

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 5, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Cmd = &cli.Command{
	Name:    "ls",
	Usage:   "lists entries",
	Aliases: []string{"l"},
	Description: `List all entries from a .kdbx database

syntax:
	./kpcli --keyfile <keyfile> \
			--database <database-filename> \
		ls  [--reverse] [--days 10] [--sort-by-col 1|2|3|4]
			; --reverse -> reverse order
			; --sort-by-col N
				1 -> title
				2 -> history count
				3 -> creation time
				4 -> mod time
			; --days 10 --> shows entries created or modified in the last 10 days

Example:
		kpcli ls --sortby-col 4 -d 2
			; shows entries modified in last 2 days ORDER by col 4(modified time)

		kpcli \
			--keyfile ./tmp/master-db.key \
			--pass 'super_secret' \
			--db ./tmp/master-db.kdbx \
			ls
	`,

	Action: runLs,
	Flags: []cli.Flag{
		&cli.StringFlag{
			Name:    "fields",
			Usage:   "fields list to be displayed",
			Aliases: []string{"f"},
		},
		&cli.BoolFlag{
			Name:    "reverse",
			Usage:   "in reverse order",
			Aliases: []string{"r"},
		},
		&cli.BoolFlag{
			Name:    "quite",
			Usage:   "less verbose",
			Aliases: []string{"q"},
		},
		&cli.StringFlag{
			Name:    "cachefile",
			Usage:   "cache result",
			Aliases: []string{"ca"},
		},
		&cli.StringFlag{
			Name:    "days",
			Usage:   "number of days ; days <= 0 means all",
			Aliases: []string{"d"},
		},
		&cli.StringFlag{
			Name:    "sortby-col",
			Usage:   "sort by column number starting 1",
			Aliases: []string{"sb"},
		},
		&cli.StringFlag{
			Name:    "output-format",
			Usage:   "Output format; available: table, csv, markdown, html",
			Aliases: []string{"of"},
		},
	},
}
View Source
var (
	TimeLayout = "2006-01-02 15:04:05"
)

Functions

func NewDB

func NewDB(opts Options) (*db, error)

NewDB create and return a new kdbx db object

Types

type Interested

type Interested struct {
	Created   time.Time
	Histories int
	KeyValues map[string]string
	Modified  time.Time
	Pass      string
	Tags      string
	Title     string
	User      string
}

type Options

type Options struct {
	CacheFile    string
	Database     string
	Days         int
	Diff         bool
	Fields       string
	Key          string
	OutputFormat string
	Pass         string
	Quite        bool
	Reverse      bool
	Sort         string
	SortbyCol    int
}

func (*Options) String

func (o *Options) String() string

Jump to

Keyboard shortcuts

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