Documentation ¶
Index ¶
- func GetEnvOrDefault(key string, defaultValue string) string
- type CLI
- func (c CLI) Contains(key string) bool
- func (c CLI) FileExists(filename string) bool
- func (c CLI) Flatten() string
- func (c *CLI) GetCommand() string
- func (c CLI) GetFileExistsOrDefault(key string, defaultValue string) string
- func (c CLI) GetFileExistsOrDie(key string) string
- func (c CLI) GetFileExistsOrDieWithMessage(key string, message string) string
- func (c CLI) GetIntOrDefault(key string, defaultValue int) int
- func (c CLI) GetIntOrDie(key string) int
- func (c CLI) GetIntOrEnvOrDefault(key string, env_key string, defaultValue int) int
- func (c CLI) GetStringFromSetOrDefault(key string, defaultValue string, permitted []string) string
- func (c CLI) GetStringFromSetOrDie(key string, permitted []string) string
- func (c CLI) GetStringOrDefault(key string, defaultValue string) string
- func (c CLI) GetStringOrDie(key string) string
- func (c CLI) GetStringOrEnvOrDefault(key string, env_key string, defaultValue string) string
- func (c CLI) GetStringOrEnvOrDie(key string, env_key string) string
- func (c CLI) IndexOf(key string) int
- func (c *CLI) Shift()
- func (c CLI) SplitStringToFloats(cols string, delim string) []float64
- func (c CLI) SplitStringToInts(cols string, delim string) []int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetEnvOrDefault ¶
GetEnvOrDefault returns an os.Getenv value or the defaultValue
Types ¶
type CLI ¶
type CLI struct { Args []string IS_INTERACTIVE bool IS_VERBOSE bool IS_VERBOSE2 bool IS_VERBOSE3 bool IS_EXIT_ON_ERROR bool }
CLI is my helper utility to work out what the user did type
func NewFromString ¶
func (CLI) FileExists ¶
FileExists asserts the filename exists and is a file
func (*CLI) GetCommand ¶
func (CLI) GetFileExistsOrDefault ¶
GetFileExistsOrDefault returns the filename associated with the key or returns the defaultValue if the file does not exist
func (CLI) GetFileExistsOrDie ¶
GetFileExistsOrDie returns the name of the file provided if it exists or failes and os.Exit(1)
func (CLI) GetFileExistsOrDieWithMessage ¶
func (CLI) GetIntOrDefault ¶
GetIntOrDefault returns the int asssociated with the key or the defaultValue
func (CLI) GetIntOrDie ¶
GetIntOrDie returns the int value associated with the passed key or fails and os.Exit(1)
func (CLI) GetIntOrEnvOrDefault ¶
func (CLI) GetStringFromSetOrDefault ¶
func (CLI) GetStringFromSetOrDie ¶
func (CLI) GetStringOrDefault ¶
GetStringOrDefault returns the value associated with the key or the defaultValue if not present
func (CLI) GetStringOrDie ¶
GetStringOrDie requires the key exist in the CLI arguments or os.Exit(1)
func (CLI) GetStringOrEnvOrDefault ¶
func (CLI) GetStringOrEnvOrDie ¶
func (CLI) SplitStringToFloats ¶
SplitStringToFloats splits the cols string based on the delimiter, converting the results in an []float64