Documentation
¶
Overview ¶
Package cl parses command line arguments.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Arguments ¶ added in v1.0.1
Arguments represents arguments returned by command line search.
type CommandLine ¶
CommandLine represents command line.
func (*CommandLine) Search ¶
func (cmdLine *CommandLine) Search(searchTerms ...string) *Arguments
Search compairs CommandLine.Arguments with searchTerms and returns matches.
func (*CommandLine) SearchByDelimiter ¶
func (cmdLine *CommandLine) SearchByDelimiter(searchTerms ...string) *Arguments
SearchByDelimiter compairs CommandLine.Arguments with searchTerms and returns matches. The search considers a delimiter, that separates key and value within parameter. Is Delimiter.HasSpaceSeparator set, then two arguments are treated as one argument with key and value separated by space.
func (*CommandLine) Unmatched ¶
func (cmdLine *CommandLine) Unmatched() *Arguments
Unmatched returns command line arguments that haven't been matched by the search.
type Delimiter ¶
Delimiter represents separators between key and value.
func NewDelimiter ¶
NewDelimiter returns a new instance of Delimiter. An empty separator "" sets the HasEmptySeparator flag for delimiter, and the space separator " " sets the HasSpaceSeparator flag.