converter

package
v2.7.2 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

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

It uses 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

New Create a new parser

func (*Converter) AddBoolParam

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

AddBoolParam Add a boolean parameter

func (*Converter) AddFloatParam added in v2.6.1

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

AddFloatParam Add an float parameter

func (*Converter) AddIntParam

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

AddIntParam Add an integer parameter

func (*Converter) AddSection

func (c *Converter) AddSection(section string)

AddSection Create a new section of config

func (*Converter) AddStringParam

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

AddStringParam Add a string parameter

func (*Converter) Fatal

func (c *Converter) Fatal(err error)

Fatal Helper to show usage, err and exit 1

func (*Converter) InitParse

func (c *Converter) InitParse()

InitParse Initialize the parser with all section and parameter.

func (*Converter) LoadConfig

func (c *Converter) LoadConfig() error

LoadConfig Load default options (config + default)

func (*Converter) Parse

func (c *Converter) Parse()

Parse all parameters

func (*Converter) Stats added in v2.4.0

func (c *Converter) Stats()

func (*Converter) Usage

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

Usage Customize version of FlagSet.PrintDefaults

func (*Converter) Validate

func (c *Converter) Validate() error

Validate Check parameters

Directories

Path Synopsis
Package options manage options with default value from config.
Package options manage options with default value from config.
Package profiles manage supported profiles for go-comic-converter.
Package profiles 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