Documentation ¶
Overview ¶
Package opt defines option and parameter types.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetOptionList ¶
func GetOptionList() string
GetOptionList returns a text of accepted command options with their help messages
Types ¶
type OptionList ¶
type OptionList []OptionType
OptionList is a slice of OptionTypes
func (OptionList) GetParams ¶
func (l OptionList) GetParams() string
GetParams runs GetParam() on an opt.OptionList and returns a concatenated string
func (OptionList) Has ¶
func (l OptionList) Has(check OptionType) bool
Has determines if the opt.OptionList contains this OptionType
type OptionType ¶
type OptionType int
OptionType is a type for our options. These can be provided with optional parameters or can be already set in commandMap
const ( DeleteSource OptionType = iota + 1 // Delete source file/object IfNotExists // Run only if destination does not exist Parents // Just like cp --parents RR // Reduced-redundancy IA // Infrequent-access Recursive // Recursive copy/move (local) ListETags // Include ETags in listing HumanReadable // Human Readable file sizes (ls, du) )
List of OptionTypes
func (OptionType) GetParam ¶
func (o OptionType) GetParam() string
GetParam returns the string/command parameter representation of a specific OptionType
func (OptionType) HelpMessage ¶
func (o OptionType) HelpMessage() string
HelpMessage returns the help message for a specific OptionType
type ParamType ¶
type ParamType int
ParamType is the type of our parameter. Determines how we validate the arguments.
const ( Unchecked ParamType = iota // Arbitrary single parameter UncheckedOneOrMore // One or more arbitrary parameters (special case) S3Obj // Bucket or bucket + key S3Dir // Bucket or bucket + key + "/" (prefix) S3ObjOrDir // Bucket or bucket + key [+ "/"] S3WildObj // Bucket + key with wildcard FileObj // Filename Dir // Dir name or non-existing name ("/" appended) FileOrDir // File or directory (if existing directory, "/" appended) Glob // String containing a valid glob pattern (non-S3) )
List of ParamTypes