Documentation ¶
Index ¶
- Constants
- Variables
- func Args(cmd *cobra.Command, args ...string) ([]string, *convert.Convert, sample.Flags, error)
- func Controls(p *[]string, cc *cobra.Command)
- func Default() encoding.Encoding
- func Encode(p *string, cc *cobra.Command)
- func EncodeAndHide(cmd *cobra.Command, dfault string) (sample.Flags, error)
- func EndOfFile(flags convert.Flag) bool
- func Help(cmd *cobra.Command, args ...string) error
- func HiddenTo(p *string, cc *cobra.Command) error
- func Init() map[int]Meta
- func OpenSample(cmd *cobra.Command, arg string, c *convert.Convert, f sample.Flags) ([]byte, error)
- func ReadArgument(arg string, cmd *cobra.Command, c *convert.Convert, f sample.Flags) ([]byte, error)
- func SAUCE(src *[]byte) create.SAUCE
- func Sort(flags map[int]Meta) []int
- func SwapChars(p *[]string, cc *cobra.Command)
- func Width(p *int, cc *cobra.Command)
- type Commands
- type Creates
- type Meta
- type Views
Examples ¶
Constants ¶
View Source
const EncodingDefault = "CP437"
Variables ¶
View Source
var Build create.Args
View Source
var ErrFilenames = errors.New("ignoring [filenames]")
View Source
var ErrHide = errors.New("could not hide the flag")
View Source
var Info struct { Format string }
View Source
var View = views()
Functions ¶
func EncodeAndHide ¶
EncodeAndHide applies the public --encode and the hidden --to encoding values to embed sample data.
func EndOfFile ¶
EndOfFile returns true if the end-of-file control flag was requested.
Example ¶
package main import ( "fmt" "github.com/bengarrett/retrotxtgo/cmd/internal/flag" "github.com/bengarrett/retrotxtgo/lib/convert" ) func main() { var f convert.Flag f.Controls = []string{"eof"} fmt.Print(flag.EndOfFile(f)) }
Output: true
func OpenSample ¶
OpenSample returns the content of the named embed sample file given via an argument.
func ReadArgument ¶
func ReadArgument(arg string, cmd *cobra.Command, c *convert.Convert, f sample.Flags) ([]byte, error)
ReadArgument returns the content of argument supplied filepath, embed sample file or piped data.
Types ¶
type Creates ¶
type Meta ¶
type Meta struct { Key string // configuration name Strg *string // StringVarP(p) argument value Boo *bool // BoolVarP(p) argument value I *uint // UintVar(p) argument value Name string // flag long name Short string // flag short name Opts []string // flag choices for display in the usage string }
Click to show internal directories.
Click to hide internal directories.