converter

package
v2.0.0-...-c09f89d Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Converter Helper to parse and prepare options for go-comic-converter.

It use goflag with additional feature:

  • Keep original order
  • Support section

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Converter

type Converter struct {
	Options *options.Options
	Cmd     *flag.FlagSet
	// contains filtered or unexported fields
}

func New

func New() *Converter

Create a new parser

func (*Converter) AddBoolParam

func (c *Converter) AddBoolParam(p *bool, name string, value bool, usage string)

Add a boolean parameter

func (*Converter) AddFloatParam

func (c *Converter) AddFloatParam(p *float64, name string, value float64, usage string)

Add an float parameter

func (*Converter) AddIntParam

func (c *Converter) AddIntParam(p *int, name string, value int, usage string)

Add an integer parameter

func (*Converter) AddSection

func (c *Converter) AddSection(section string)

Create a new section of config

func (*Converter) AddStringParam

func (c *Converter) AddStringParam(p *string, name string, value string, usage string)

Add a string parameter

func (*Converter) Fatal

func (c *Converter) Fatal(err error)

Helper to show usage, err and exit 1

func (*Converter) InitParse

func (c *Converter) InitParse()

Initialize the parser with all section and parameter.

func (*Converter) LoadConfig

func (c *Converter) LoadConfig() error

Load default options (config + default)

func (*Converter) Parse

func (c *Converter) Parse()

Parse all parameters

func (*Converter) Stats

func (c *Converter) Stats()

func (*Converter) Usage

func (c *Converter) Usage(isString bool, f *flag.Flag) string

Customize version of FlagSet.PrintDefaults

func (*Converter) Validate

func (c *Converter) Validate() error

Check parameters

Directories

Path Synopsis
Manage options with default value from config.
Manage options with default value from config.
Manage supported profiles for go-comic-converter.
Manage supported profiles for go-comic-converter.

Jump to

Keyboard shortcuts

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