clargs

package
v0.0.0-...-ad6479d Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArgList

type ArgList struct {
	// contains filtered or unexported fields

} // look in storagemethods for impl

func NewArgList

func NewArgList() *ArgList

NewArgList returns a pointer to ArgList. ex. MainList := clargs.NewArgList()

func (*ArgList) Add

func (st *ArgList) Add(a *CommandLineArg) error

(*ArgList) Add(arg) appends an arg and makes it current. Cannot Add a name that is already in the list

func (*ArgList) Current

func (st *ArgList) Current() (*CommandLineArg, bool)

(*ArgList) Current() returns the current arg

func (*ArgList) Delete

func (st *ArgList) Delete(name string) bool

(*ArgList) Delete(string) marks an arg as deleted and if it is current advances or retreats as needed. Returns success or failure.

func (*ArgList) DeleteAndPurge

func (st *ArgList) DeleteAndPurge(name string) bool

(*ArgList) DeleteAndPurge(string) calls Delete followed by Purge

func (*ArgList) Empty

func (st *ArgList) Empty() bool

(*ArgList) Empty() reports if there are 0 elements being stored

func (*ArgList) Exists

func (st *ArgList) Exists(name string) bool

(*ArgList) Exists(string) returns true if the name can be found

func (*ArgList) Get

func (st *ArgList) Get(name string) *CommandLineArg

(*ArgList) Get(string) performs a lookup by arg.Name and returns it if found

func (*ArgList) Head

func (st *ArgList) Head() *CommandLineArg

(*ArgList) Head() returns the list Head

func (*ArgList) IsChild

func (st *ArgList) IsChild(name string) bool

(*ArgList) isChild checks for parent of named arg

func (*ArgList) IsDeleted

func (st *ArgList) IsDeleted(name string) bool

(*ArgList) IsDeleted(string) returns the deletion status of the named arg

func (*ArgList) IsParent

func (st *ArgList) IsParent(name string) bool

(*ArgList) IsParent checks for children of named arg

func (*ArgList) Len

func (st *ArgList) Len() int

(*ArgList) Len() returns the number of elements being stored

func (*ArgList) Names

func (st *ArgList) Names() []string

Names() returns a slice of strings holding the command names

func (*ArgList) Next

func (st *ArgList) Next() (*CommandLineArg, bool)

(*ArgList) Next() returns the next arg and advances current. if current has children the head of that list will be next.

func (*ArgList) Previous

func (st *ArgList) Previous() (*CommandLineArg, bool)

(*ArgList) Previous() returns the previous arg and makes it current

func (*ArgList) Print

func (st *ArgList) Print(name string)

for debugging

func (*ArgList) PrintAll

func (st *ArgList) PrintAll()

func (*ArgList) Purge

func (st *ArgList) Purge(name string) bool

(*ArgList) Purge(string) removes a deleted arg from the linked list if found this can be dangerous as its children are purged as well

func (*ArgList) Reset

func (st *ArgList) Reset()

(*ArgList) Reset()sets current to Head

func (*ArgList) ResetAll

func (st *ArgList) ResetAll()

(*ArgList) ResetAll() rids the list of all data

func (*ArgList) SetCurrent

func (st *ArgList) SetCurrent(name string) bool

(*ArgList) SetCurrent(string) takes a name and if found makes it the current arg

func (*ArgList) SortedNames

func (st *ArgList) SortedNames() []string

(*ArgList) SortedNames() returns a slice of names sorted a-z

func (*ArgList) Tail

func (st *ArgList) Tail() (*CommandLineArg, bool)

(*ArgList) Tail() returns the list Tail

func (*ArgList) UnDelete

func (st *ArgList) UnDelete(name string) bool

(*ArgList) UnDelete(string) unmarks an arg as deleted and makes it current

func (*ArgList) Update

func (st *ArgList) Update(a *CommandLineArg) error

(*ArgList) Update(arg) tries to Add(arg) and if it already exists will replace the existing one with the passed arg

type CommandLineArg

type CommandLineArg struct {
	Arg *boa.CmdLineItem
	// contains filtered or unexported fields

} // look in itemmethods.go for impl

func NewCommandLineArg

func NewCommandLineArg(arg *boa.CmdLineItem) *CommandLineArg

NewCommandLineArg constructs and returns a *CommandLineArg

func (CommandLineArg) Alias

func (c CommandLineArg) Alias() string

func (CommandLineArg) Children

func (c CommandLineArg) Children() []string

func (CommandLineArg) DefaultValue

func (c CommandLineArg) DefaultValue() string

func (CommandLineArg) Deleted

func (c CommandLineArg) Deleted() bool

func (CommandLineArg) Errors

func (c CommandLineArg) Errors() string

func (CommandLineArg) ID

func (c CommandLineArg) ID() int

func (CommandLineArg) IsDefault

func (c CommandLineArg) IsDefault() bool

func (CommandLineArg) IsExclusive

func (c CommandLineArg) IsExclusive() bool

func (CommandLineArg) IsParamOpt

func (c CommandLineArg) IsParamOpt() bool

func (CommandLineArg) IsRequired

func (c CommandLineArg) IsRequired() bool

func (CommandLineArg) Kind

func (c CommandLineArg) Kind() con.ArgType

func (CommandLineArg) LongHelp

func (c CommandLineArg) LongHelp() string

func (CommandLineArg) Name

func (c CommandLineArg) Name() string

func (CommandLineArg) ParamCount

func (c CommandLineArg) ParamCount() int

func (CommandLineArg) ParamType

func (c CommandLineArg) ParamType() boa.ParameterType

func (CommandLineArg) Parent

func (c CommandLineArg) Parent() string

func (CommandLineArg) RunCode

func (c CommandLineArg) RunCode() string

func (CommandLineArg) ShortHelp

func (c CommandLineArg) ShortHelp() string

Jump to

Keyboard shortcuts

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