options

package
v1.4.5 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2019 License: GPL-2.0, GPL-2.0-or-later Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Family = []interface{}{"-4", "-6", "-B", "-M", "-0"}
	Flags  = []interface{}{
		[]string{"-h", "-human", "-human-readable"},
		[]string{"-s", "-stats", "-statistics"},
		[]string{"-d", "-details"},
		[]string{"-o", "-oneline"},
		[]string{"-r", "-resolve"},
		[]string{"-a", "-all"},
		[]string{"-c", "-color"},
		[]string{"-t", "-timestamp"},
		[]string{"-ts", "-tshort"},
		"-iec",
	}
	Parms = []interface{}{
		[]string{"-l", "-loops"},
		[]string{"-f", "-family"},
		[]string{"-rc", "-rcvbuf"},
	}
	CompleteParmValue = map[string]func(string) []string{
		"-l":      NoComplete,
		"-loops":  NoComplete,
		"-rc":     NoComplete,
		"-rcvbuf": NoComplete,
		"-f":      CompleteFamily,
		"-family": CompleteFamily,
	}
	CompleteOptNames = []string{
		"-human-readable",
		"-statistics",
		"-details",
		"-oneline",
		"-resolve",
		"-all",
		"-color",
		"-timestamp",
		"-tshort",
		"-iec",
		"-family",
		"-loops",
		"-rcvbuf",
	}
)

Functions

func CompleteFamily

func CompleteFamily(s string) (list []string)

func CompleteFile

func CompleteFile(s string) (list []string)

func CompleteIfName

func CompleteIfName(s string) (list []string)

func NoComplete

func NoComplete(string) []string

Types

type Gid

type Gid uint32

type Newline

type Newline struct{}

type Options

type Options struct {
	Flags *flags.Flags
	Parms *parms.Parms
}

func New

func New(args []string) (*Options, []string)

Parse common IP options from command arguments.

func (*Options) Afs

func (opt *Options) Afs() []uint8

func (*Options) Name

func (opt *Options) Name(args []string) ([]string, error)

Unless already set, use args[0] for "name".

func (*Options) Nprint

func (opt *Options) Nprint(n int, args ...interface{}) (int, error)

Print args then pad with spaces to at least N runes. If the printed args were more than N runes, pad with 1 space.

func (*Options) OnlyName

func (opt *Options) OnlyName(args []string) error

Error on args[1:]; otherwise use args[0] for "name".

func (*Options) Print

func (opt *Options) Print(args ...interface{}) (int, error)

func (*Options) Println

func (opt *Options) Println(args ...interface{}) (int, error)

func (*Options) ShowIfAddr

func (opt *Options) ShowIfAddr(b []byte, withCacheInfo bool)

func (*Options) ShowIfAddrLbl

func (opt *Options) ShowIfAddrLbl(b []byte)

func (*Options) ShowIfFlags

func (opt *Options) ShowIfFlags(iff uint32)

func (*Options) ShowIfInfo

func (opt *Options) ShowIfInfo(b []byte)

func (*Options) ShowIfStats

func (opt *Options) ShowIfStats(val []byte)

func (*Options) ShowIflaVf

func (opt *Options) ShowIflaVf(b []byte)

func (*Options) ShowNeigh

func (opt *Options) ShowNeigh(b []byte)

func (*Options) ShowNetconf

func (opt *Options) ShowNetconf(b []byte)

func (*Options) ShowPrefix

func (opt *Options) ShowPrefix(b []byte)

func (*Options) ShowRoute

func (opt *Options) ShowRoute(b []byte)

func (*Options) ShowRule

func (opt *Options) ShowRule(b []byte)

func (*Options) ShowVfStats

func (opt *Options) ShowVfStats(vfstats [][]byte)

func (*Options) Vprint

func (opt *Options) Vprint(v interface{}) (n int, err error)

type Stat

type Stat uint64

Jump to

Keyboard shortcuts

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