cli

package
v2.2.4 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package cli provides helpers to work with command-line interface.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEmptyFilename         = errors.New("cli: empty filename")
	ErrInsufficientArguments = errors.New("cli: insufficient command-line arguments")
	ErrInvalidFilename       = errors.New("cli: invalid filename")
	ErrParseFloat            = errors.New("cli: failed to parse float")
	ErrReadString            = errors.New("cli: failed to read string")
	ErrTooManyArguments      = errors.New("cli: too many arguments")
)

Functions

func Filename

func Filename(args []string) (string, error)

Filename returns the value of args[1] as the required filename, os.Args is required to pass in args.

func GetFloat

func GetFloat() (float64, error)

GetFloat reads a floating-point number from os.Stdin. It returns the number read and any error encountered.

func ProgName added in v2.2.0

func ProgName(args []string) string

ProgName returns the program name from the command-line arguments.

Types

This section is empty.

Jump to

Keyboard shortcuts

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