cli

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package cli manages loading and testing configuration for serializing and deserializing objects from the command line.

Index

Constants

View Source
const (
	FlagInputURI              string = "input-uri"
	FlagInputCompression      string = "input-compression"
	FlagInputFormat           string = "input-format"
	FlagInputHeader           string = "input-header"
	FlagInputLimit            string = "input-limit"
	FlagInputComment          string = "input-comment"
	FlagInputLazyQuotes       string = "input-lazy-quotes"
	FlagInputTrim             string = "input-trim"
	FlagInputReaderBufferSize string = "input-reader-buffer-size"
	FlagInputSkipLines        string = "input-skip-lines"
	FlagInputLineSeparator    string = "input-line-separator"
	FlagInputDropCR           string = "input-drop-cr"
	FlagInputEscapePrefix     string = "input-escape-prefix"
	FlagInputUnescapeColon    string = "input-unescape-colon"
	FlagInputUnescapeEqual    string = "input-unescape-equal"
	FlagInputUnescapeSpace    string = "input-unescape-space"
	FlagInputUnescapeNewLine  string = "input-unescape-new-line"

	DefaultSkipLines  int = 0
	DefaultInputLimit int = -1
)
View Source
const (
	FlagOutputURI               string = "output-uri"
	FlagOutputCompression       string = "output-compression"
	FlagOutputFormat            string = "output-format"
	FlagOutputPretty            string = "output-pretty"
	FlagOutputHeader            string = "output-header"
	FlagOutputLimit             string = "output-limit"
	FlagOutputAppend            string = "output-append"
	FlagOutputOverwrite         string = "output-overwrite"
	FlagOutputBufferMemory      string = "output-buffer-memory"
	FlagOutputMkdirs            string = "output-mkdirs"
	FlagOutputPassphrase        string = "output-passphrase"
	FlagOutputSalt              string = "output-salt"
	FlagOutputDecimal           string = "output-decimal"
	FlagOutputKeyLower          string = "output-key-lower"
	FlagOutputKeyUpper          string = "output-key-upper"
	FlagOutputValueLower        string = "output-value-lower"
	FlagOutputValueUpper        string = "output-value-upper"
	FlagOutputNoDataValue       string = "output-no-data-value"
	FlagOutputLineSeparator     string = "output-line-separator"
	FlagOutputKeyValueSeparator string = "output-key-value-separator"
	FlagOutputExpandHeader      string = "output-expand-header"
	FlagOutputEscapePrefix      string = "output-escape-prefix"
	FlagOutputEscapeColon       string = "output-escape-colon"
	FlagOutputEscapeEqual       string = "output-escape-equal"
	FlagOutputEscapeNewLine     string = "output-escape-new-line"
	FlagOutputEscapeSpace       string = "output-escape-space"
	FlagOutputSorted            string = "output-sorted"
	FlagOutputReversed          string = "output-reversed"

	DefaultOutputLimit = -1
)

Variables

View Source
var (
	ErrMissingLineSeparator = errors.New("line separator cannot be blank")
	ErrMissingEscapePrefix  = errors.New("escape prefix is missing")
)
View Source
var (
	DefaultInputHeader = []string{}
)
View Source
var (
	DefaultOutputHeader = []string{}
)

Functions

func CheckInput

func CheckInput(v *viper.Viper, formats []string) error

CheckInput checks the output configuration.

func CheckOutput

func CheckOutput(v *viper.Viper, formats []string) error

CheckOutput checks the output configuration.

func InitInputFlags

func InitInputFlags(flag *pflag.FlagSet, formats []string)

Initialize input flags

func InitOutputFlags

func InitOutputFlags(flag *pflag.FlagSet, formats []string)

Initialize output flags

Types

type ErrInvalidInputFormat

type ErrInvalidInputFormat struct {
	Value    string
	Expected []string
}

func (ErrInvalidInputFormat) Error

func (e ErrInvalidInputFormat) Error() string

type ErrInvalidOutputFormat

type ErrInvalidOutputFormat struct {
	Value    string
	Expected []string
}

func (ErrInvalidOutputFormat) Error

func (e ErrInvalidOutputFormat) Error() string

type ErrMissingInputFormat

type ErrMissingInputFormat struct {
	Expected []string
}

func (ErrMissingInputFormat) Error

func (e ErrMissingInputFormat) Error() string

type ErrMissingOutputFormat

type ErrMissingOutputFormat struct {
	Expected []string
}

func (ErrMissingOutputFormat) Error

func (e ErrMissingOutputFormat) Error() string

Jump to

Keyboard shortcuts

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