cli

package
v0.23.0 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2024 License: MPL-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Usage

func Usage(commands []Cmd)

Usage prints the command usage

Types

type AddCmd

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

Add adds an item to the vault

func (*AddCmd) Description

func (cmd *AddCmd) Description() string

Description returns the command description

func (*AddCmd) Name

func (cmd *AddCmd) Name() string

Name returns the one word command name

func (*AddCmd) Parse

func (cmd *AddCmd) Parse(args []string) error

Parse parses the arguments and set the usage for the command

func (*AddCmd) Run

func (cmd *AddCmd) Run(s paw.Storage) error

Run runs the command

func (AddCmd) String

func (i AddCmd) String() string

func (*AddCmd) Usage

func (cmd *AddCmd) Usage()

Usage displays the command usage

type AgentCmd added in v0.20.0

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

Agent manages the Paw agent

func (*AgentCmd) Description added in v0.20.0

func (cmd *AgentCmd) Description() string

Description returns the command description

func (*AgentCmd) Name added in v0.20.0

func (cmd *AgentCmd) Name() string

Name returns the one word command name

func (*AgentCmd) Parse added in v0.20.0

func (cmd *AgentCmd) Parse(args []string) error

Parse parses the arguments and set the usage for the command

func (*AgentCmd) Run added in v0.20.0

func (cmd *AgentCmd) Run(s paw.Storage) error

Run runs the command

func (*AgentCmd) Usage added in v0.20.0

func (cmd *AgentCmd) Usage()

Usage displays the command usage

type Cmd

type Cmd interface {
	Name() string              // Name returns the one word command name
	Description() string       // Description returns the command description
	Parse(args []string) error // Parse parses the cli arguments
	Usage()                    // Usage displays the command usage
	Run(s paw.Storage) error   // Run runs the command
}

Cmd wraps the methods for a paw cli command

func New added in v0.21.0

func New(s paw.Storage) (Cmd, error)

type CommonFlags

type CommonFlags struct {
	// Help displays the command help and exit
	Help bool
	// SessionID is the session ID
	SessionID string
}

CommonFlags holds the flags shared between all commands

func (*CommonFlags) Parse added in v0.20.0

func (f *CommonFlags) Parse(cmd Cmd, args []string)

func (*CommonFlags) SetEnv added in v0.20.0

func (f *CommonFlags) SetEnv()

SetEnv sets the env variables according to the flag values

type EditCmd

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

Edit edits an item into the vault

func (*EditCmd) Description

func (cmd *EditCmd) Description() string

Description returns the command description

func (*EditCmd) Name

func (cmd *EditCmd) Name() string

Name returns the one word command name

func (*EditCmd) Parse

func (cmd *EditCmd) Parse(args []string) error

Parse parses the arguments and set the usage for the command

func (*EditCmd) Run

func (cmd *EditCmd) Run(s paw.Storage) error

Run runs the command

func (EditCmd) String

func (i EditCmd) String() string

func (*EditCmd) Usage

func (cmd *EditCmd) Usage()

Usage displays the command usage

type InitCmd

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

Init initializes a vault

func (*InitCmd) Description

func (cmd *InitCmd) Description() string

Description returns the command description

func (*InitCmd) Name

func (cmd *InitCmd) Name() string

Name returns the one word command name

func (*InitCmd) Parse

func (cmd *InitCmd) Parse(args []string) error

Parse parses the arguments and set the usage for the command

func (*InitCmd) Run

func (cmd *InitCmd) Run(s paw.Storage) error

Run runs the command

func (*InitCmd) Usage

func (cmd *InitCmd) Usage()

Usage displays the command usage

type ListCmd

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

List lists the vaults content

func (*ListCmd) Description

func (cmd *ListCmd) Description() string

Description returns the command description

func (*ListCmd) Name

func (cmd *ListCmd) Name() string

Name returns the one word command name

func (*ListCmd) Parse

func (cmd *ListCmd) Parse(args []string) error

Parse parses the arguments and set the usage for the command

func (*ListCmd) Run

func (cmd *ListCmd) Run(s paw.Storage) error

Run runs the command

func (ListCmd) String

func (i ListCmd) String() string

func (*ListCmd) Usage

func (cmd *ListCmd) Usage()

Usage displays the command usage

type LockCmd added in v0.20.0

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

Lock locks a Paw vault removing all the associated sessions from the agent

func (*LockCmd) Description added in v0.20.0

func (cmd *LockCmd) Description() string

Description returns the command description

func (*LockCmd) Name added in v0.20.0

func (cmd *LockCmd) Name() string

Name returns the one word command name

func (*LockCmd) Parse added in v0.20.0

func (cmd *LockCmd) Parse(args []string) error

Parse parses the arguments and set the usage for the command

func (*LockCmd) Run added in v0.20.0

func (cmd *LockCmd) Run(s paw.Storage) error

Run runs the command

func (*LockCmd) Usage added in v0.20.0

func (cmd *LockCmd) Usage()

Usage displays the command usage

type PwGenCmd

type PwGenCmd struct{}

PwGenCmd generates a password

func (*PwGenCmd) Description

func (cmd *PwGenCmd) Description() string

Description returns the command description

func (*PwGenCmd) Name

func (cmd *PwGenCmd) Name() string

Name returns the one word command name

func (*PwGenCmd) Parse

func (cmd *PwGenCmd) Parse(args []string) error

Parse parses the arguments and set the usage for the command

func (*PwGenCmd) Pwgen

func (cmd *PwGenCmd) Pwgen(key *paw.Key, modes []paw.PasswordMode, defaultMode paw.PasswordMode) (*paw.Password, error)

func (*PwGenCmd) Run

func (cmd *PwGenCmd) Run(s paw.Storage) error

Run runs the command

func (*PwGenCmd) Usage

func (cmd *PwGenCmd) Usage()

Usage displays the command usage

type RemoveCmd

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

RemoveCmd removes an item from the vault

func (*RemoveCmd) Description

func (cmd *RemoveCmd) Description() string

Description returns the command description

func (*RemoveCmd) Name

func (cmd *RemoveCmd) Name() string

Name returns the one word command name

func (*RemoveCmd) Parse

func (cmd *RemoveCmd) Parse(args []string) error

Parse parses the arguments and set the usage for the command

func (*RemoveCmd) Run

func (cmd *RemoveCmd) Run(s paw.Storage) error

Run runs the command

func (RemoveCmd) String

func (i RemoveCmd) String() string

func (*RemoveCmd) Usage

func (cmd *RemoveCmd) Usage()

Usage displays the command usage

type ShowCmd

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

Show shows an item details

func (*ShowCmd) Description

func (cmd *ShowCmd) Description() string

Description returns the command description

func (*ShowCmd) Name

func (cmd *ShowCmd) Name() string

Name returns the one word command name

func (*ShowCmd) Parse

func (cmd *ShowCmd) Parse(args []string) error

Parse parses the arguments and set the usage for the command

func (*ShowCmd) Run

func (cmd *ShowCmd) Run(s paw.Storage) error

Run runs the command

func (ShowCmd) String

func (i ShowCmd) String() string

func (*ShowCmd) Usage

func (cmd *ShowCmd) Usage()

Usage displays the command usage

type UnlockCmd added in v0.20.0

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

UnlockCmd unlock a vault and starts a session returning its ID

func (*UnlockCmd) Description added in v0.20.0

func (cmd *UnlockCmd) Description() string

Description returns the command description

func (*UnlockCmd) Name added in v0.20.0

func (cmd *UnlockCmd) Name() string

Name returns the one word command name

func (*UnlockCmd) Parse added in v0.20.0

func (cmd *UnlockCmd) Parse(args []string) error

Parse parses the arguments and set the usage for the command

func (*UnlockCmd) Run added in v0.20.0

func (cmd *UnlockCmd) Run(s paw.Storage) error

Run runs the command

func (*UnlockCmd) Usage added in v0.20.0

func (cmd *UnlockCmd) Usage()

Usage displays the command usage

type VersionCmd

type VersionCmd struct{}

Version is the version command

func (*VersionCmd) Description

func (cmd *VersionCmd) Description() string

Description returns the command description

func (*VersionCmd) Name

func (cmd *VersionCmd) Name() string

Name returns the one word command name

func (*VersionCmd) Parse

func (cmd *VersionCmd) Parse(args []string) error

Parse parses the arguments and set the usage for the command

func (*VersionCmd) Run

func (cmd *VersionCmd) Run(s paw.Storage) error

Run runs the command

func (*VersionCmd) Usage

func (cmd *VersionCmd) Usage()

Usage displays the command usage

Jump to

Keyboard shortcuts

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