flags

package
v3.11.2+incompatible Latest Latest
Warning

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

Go to latest
Published: May 11, 2018 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

This package is a simple cobra/viper-aware flag wrapper that creates a unified interface for flag addition and access. It supports only the types that iscenv needs, if you need more add them.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddConfigFlag

func AddConfigFlag(cmd *cobra.Command, name string, value interface{}, usage string)

func AddConfigFlagP

func AddConfigFlagP(cmd *cobra.Command, name string, shorthand string, value interface{}, usage string)

func AddFlag

func AddFlag(cmd *cobra.Command, name string, value interface{}, usage string)

func AddFlagComplex

func AddFlagComplex(cmd *cobra.Command, persistent bool, cfg bool, name string, shorthand string, value interface{}, usage string)

Add a flag to the provided cobra command. The default value will determine the type of flag. Supported types are: string, bool, int64, uint, []string

func AddFlagP

func AddFlagP(cmd *cobra.Command, name string, shorthand string, value interface{}, usage string)

func GetBool

func GetBool(cmd *cobra.Command, name string) bool

func GetFlagKey

func GetFlagKey(cmd *cobra.Command, name string) string

func GetInt

func GetInt(cmd *cobra.Command, name string) int

func GetInt64

func GetInt64(cmd *cobra.Command, name string) int64

func GetKeys

func GetKeys() []string

func GetRawValue

func GetRawValue(key string) interface{}

func GetString

func GetString(cmd *cobra.Command, name string) string

func GetStringSlice

func GetStringSlice(cmd *cobra.Command, name string) []string

func GetUint

func GetUint(cmd *cobra.Command, name string) uint

func GetValue

func GetValue(cmd *cobra.Command, name string) interface{}

func GetValueWithKey

func GetValueWithKey(key string) interface{}

Types

This section is empty.

Jump to

Keyboard shortcuts

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