Documentation ¶
Index ¶
Constants ¶
const ( TrueHlc = "true" YesHlc = "yes" OnHlc = "on" FalseHlc = "false" NoHlc = "no" OffHlc = "off" )
common and global hlcs.
Variables ¶
This section is empty.
Functions ¶
func IsEqualitySign ¶
func ToBoolType ¶
Types ¶
type Arg ¶
type Arg []string
Arg is the arguments for commands
func (*Arg) GetNonFlags ¶
GetFlags will give you all of the non-flags of this Arg value. Notice: if the _a has no non-flag value, this function will give you nil (or an array with zero length).
func (*Arg) HasFlag ¶
HasFlag will check if at least one of the flags is present in flags or not. notice: this method, will check for at least one of them, it means if it finds one of the flags value, it will return true. if you want to search for all of them, consider using HasFlags.
func (*Arg) HasFlags ¶
HasFlags will check if all of the flags are present in flags or not. notice: this method, will check for all of them, it means if it doesn't find one of the flags value, it will return false. if you want to search for at least one of them, consider using HasFlag.
func (*Arg) JoinNoneFlags ¶
JoinNoneFlags will join all the none-flags elements in the arg. set command to true if you want to include the command itself.
type EventArgs ¶
type EventArgs struct {
ParseError *string
}
func ParseArg ¶
func ParseArg(text string, hlc HlcCollection) *EventArgs
type Flag ¶
Flag is the options passed along with the commands by users. they should send them with prefex "--", but we will remove them in the pTools.
type FlagType ¶
type FlagType uint8
const ( NoneFlagType FlagType = 0 BoolFlagType FlagType = 1 StringFlagType FlagType = 2 UInt8FlagType FlagType = 3 UInt16FlagType FlagType = 4 UInt32FlagType FlagType = 5 UInt64FlagType FlagType = 6 Int8FlagType FlagType = 7 Int16FlagType FlagType = 8 Int32FlagType FlagType = 9 Int64FlagType FlagType = 10 )
type HlcCollection ¶
type HlcCollection []Hlc
func GetHlcCollection ¶
func GetHlcCollection(h ...Hlc) HlcCollection
func (*HlcCollection) Contains ¶
func (c *HlcCollection) Contains(name string) bool
func (*HlcCollection) GetValue ¶
func (c *HlcCollection) GetValue(name string) (interface{}, FlagType)