libcmdline

package module
v0.0.0-...-33bcda2 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2015 License: BSD-3-Clause Imports: 6 Imported by: 0

README

go-libcmdline

A small library for handing command line flags

Documentation

Index

Constants

This section is empty.

Variables

View Source
var G = &libkb.G

Keep this around to simplify things

Functions

func HandleSignals

func HandleSignals()

func Main

func Main(parseArgs parseArgHook, ui libkb.UI, canBeClient bool)

Types

type CmdBaseHelp

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

func (*CmdBaseHelp) GetUsage

func (c *CmdBaseHelp) GetUsage() libkb.Usage

func (*CmdBaseHelp) ParseArgv

func (c *CmdBaseHelp) ParseArgv(*cli.Context) error

func (*CmdBaseHelp) Run

func (c *CmdBaseHelp) Run() error

func (*CmdBaseHelp) RunClient

func (c *CmdBaseHelp) RunClient() error

type CmdGeneralHelp

type CmdGeneralHelp struct {
	CmdBaseHelp
}

type CmdSpecificHelp

type CmdSpecificHelp struct {
	CmdBaseHelp
	// contains filtered or unexported fields
}

func (CmdSpecificHelp) Run

func (c CmdSpecificHelp) Run() error

type Command

type Command interface {
	libkb.Command
	ParseArgv(*cli.Context) error // A command-specific parse-args
	Run() error                   // Actually run the command (finally!)
	RunClient() error             // Run in client mode
}

type CommandLine

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

func NewCommandLine

func NewCommandLine(addHelp bool) *CommandLine

func (*CommandLine) AddCommands

func (cl *CommandLine) AddCommands(cmds []cli.Command)

func (*CommandLine) ChooseCommand

func (p *CommandLine) ChooseCommand(cmd Command, name string, ctx *cli.Context)

Called back from inside our subcommands, when they're picked...

func (CommandLine) GetApiDump

func (p CommandLine) GetApiDump() (bool, bool)

func (CommandLine) GetBool

func (p CommandLine) GetBool(s string, glbl bool) (bool, bool)

func (CommandLine) GetConfigFilename

func (p CommandLine) GetConfigFilename() string

func (CommandLine) GetDaemonPort

func (p CommandLine) GetDaemonPort() (ret int, set bool)

func (CommandLine) GetDbFilename

func (p CommandLine) GetDbFilename() string

func (CommandLine) GetDebug

func (p CommandLine) GetDebug() (bool, bool)

func (CommandLine) GetEmail

func (p CommandLine) GetEmail() string

func (CommandLine) GetGInt

func (p CommandLine) GetGInt(s string) int

func (CommandLine) GetGString

func (p CommandLine) GetGString(s string) string

func (CommandLine) GetGpg

func (p CommandLine) GetGpg() string

func (CommandLine) GetGpgOptions

func (p CommandLine) GetGpgOptions() []string

func (CommandLine) GetHome

func (p CommandLine) GetHome() string

func (CommandLine) GetLocalRpcDebug

func (p CommandLine) GetLocalRpcDebug() string

func (CommandLine) GetMerkleKeyFingerprints

func (p CommandLine) GetMerkleKeyFingerprints() []string

func (CommandLine) GetPgpDir

func (p CommandLine) GetPgpDir() string

func (CommandLine) GetPgpFingerprint

func (p CommandLine) GetPgpFingerprint() *libkb.PgpFingerprint

func (CommandLine) GetPinentry

func (p CommandLine) GetPinentry() string

func (CommandLine) GetPlainLogging

func (p CommandLine) GetPlainLogging() (bool, bool)

func (CommandLine) GetProofCacheSize

func (p CommandLine) GetProofCacheSize() (int, bool)

func (CommandLine) GetProxy

func (p CommandLine) GetProxy() string

func (CommandLine) GetSecretKeyring

func (p CommandLine) GetSecretKeyring() string

func (CommandLine) GetServerUri

func (p CommandLine) GetServerUri() string

func (CommandLine) GetSessionFilename

func (p CommandLine) GetSessionFilename() string

func (CommandLine) GetSocketFile

func (p CommandLine) GetSocketFile() string

func (CommandLine) GetStandalone

func (p CommandLine) GetStandalone() (bool, bool)

func (CommandLine) GetUid

func (p CommandLine) GetUid() *libkb.UID

func (CommandLine) GetUserCacheSize

func (p CommandLine) GetUserCacheSize() (int, bool)

func (CommandLine) GetUsername

func (p CommandLine) GetUsername() string

func (*CommandLine) Parse

func (p *CommandLine) Parse(args []string) (cmd Command, err error)

func (*CommandLine) PopulateApp

func (cl *CommandLine) PopulateApp(addHelp bool)

func (*CommandLine) SetDefaultCommand

func (cl *CommandLine) SetDefaultCommand(name string, cmd Command)

Jump to

Keyboard shortcuts

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