cmd

package
v0.2.9 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2017 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CSV_EXT = ".csv"
	TSV_EXT = ".tsv"
)
View Source
const UNDEF = -1

Variables

This section is empty.

Functions

func CreateFile added in v0.1.6

func CreateFile(file string, s string) error

func GetLocation

func GetLocation() *time.Location

func GetRand

func GetRand() *rand.Rand

func GetReader

func GetReader(r io.Reader, enc Encoding) io.Reader

func Now

func Now() time.Time

func SetDatetimeFormat added in v0.2.7

func SetDatetimeFormat(s string)

func SetDelimiter

func SetDelimiter(s string) error

func SetEncoding

func SetEncoding(s string) error

func SetFormat

func SetFormat(s string) error

func SetLineBreak

func SetLineBreak(s string) error

func SetNoHeader

func SetNoHeader(b bool)

func SetOut

func SetOut(s string) error

func SetRepository

func SetRepository(s string) error

func SetSource added in v0.1.6

func SetSource(s string) error

func SetWithoutHeader

func SetWithoutHeader(b bool)

func SetWithoutNull

func SetWithoutNull(b bool)

func SetWriteDelimiter

func SetWriteDelimiter(s string) error

func SetWriteEncoding

func SetWriteEncoding(s string) error

func ToStdout added in v0.1.6

func ToStdout(s string) error

func UnescapeString added in v0.1.5

func UnescapeString(s string) string

func UpdateFile added in v0.1.6

func UpdateFile(file string, s string) error

Types

type Encoding

type Encoding string
const (
	UTF8 Encoding = "UTF8"
	SJIS Encoding = "SJIS"
)

func ParseEncoding

func ParseEncoding(s string) (Encoding, error)

func (Encoding) String added in v0.1.6

func (e Encoding) String() string

type Flags

type Flags struct {
	// Global Options
	Delimiter      rune
	Encoding       Encoding
	LineBreak      LineBreak
	Repository     string
	Source         string
	DatetimeFormat string
	NoHeader       bool
	WithoutNull    bool

	// Write Subcommand Options
	WriteEncoding  Encoding
	OutFile        string
	Format         Format
	WriteDelimiter rune
	WithoutHeader  bool

	// Use in tests
	Location string
	Now      string
}

func GetFlags

func GetFlags() *Flags

type Format

type Format int
const (
	TEXT Format = iota
	CSV
	TSV
	JSON
)

type LineBreak

type LineBreak string
const (
	CR   LineBreak = "\r"
	LF   LineBreak = "\n"
	CRLF LineBreak = "\r\n"
)

func (LineBreak) Value

func (lb LineBreak) Value() string

Jump to

Keyboard shortcuts

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