commandline

package
v0.0.0-...-d9421b2 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package commandline contains helper types for collecting command-line arguments.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ReplaceRule

type ReplaceRule struct {
	From *regexp.Regexp
	To   string
}

A ReplaceRule maps a pattern to its replacement. On the command line, ReplaceRules are provided as strings separated by "->".

type ReplaceRuleList

type ReplaceRuleList []ReplaceRule

A ReplaceRuleList is used to collect multiple replacement rules from the command line.

func (*ReplaceRuleList) Set

func (r *ReplaceRuleList) Set(s string) error

Set adds a replacement rule to the ReplaceRuleList, in the order provided on the command line.

func (*ReplaceRuleList) String

func (r *ReplaceRuleList) String() string

type Strings

type Strings []string

The Strings type can be used to collect multiple command-line options, in the order provided.

func (*Strings) Set

func (s *Strings) Set(val string) error

func (*Strings) String

func (s *Strings) String() string

Jump to

Keyboard shortcuts

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