cli

package
v2.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TermsharkOnly = []string{"--pass-thru", "--profile", "--log-tty", "--debug", "--tail"}

If args are passed through to tshark (e.g. stdout not a tty), then strip these out so tshark doesn't fail.

Functions

func FlagIsTrue

func FlagIsTrue(val string) bool

Types

type PlatformSwitches

type PlatformSwitches struct {
	Tty string `long:"tty" description:"Display the UI on this terminal." value-name:"<tty>"`
}

Embedded in the CLI options struct.

func (PlatformSwitches) TtyValue

func (p PlatformSwitches) TtyValue() string

type TailSwitch

type TailSwitch struct{}

func (TailSwitch) TailFileValue

func (t TailSwitch) TailFileValue() string

type Termshark

type Termshark struct {
	Ifaces          []string       `value-name:"<interfaces>" short:"i" description:"Interface(s) to read."`
	Pcap            flags.Filename `value-name:"<infile/fifo>" short:"r" description:"Pcap file/fifo to read. Use - for stdin."`
	WriteTo         flags.Filename `value-name:"<outfile>" short:"w" description:"Write raw packet data to outfile."`
	DecodeAs        []string       `short:"d" description:"Specify dissection of layer type." value-name:"<layer type>==<selector>,<decode-as protocol>"`
	PrintIfaces     bool           `short:"D" optional:"true" optional-value:"true" description:"Print a list of the interfaces on which termshark can capture."`
	DisplayFilter   string         `short:"Y" description:"Apply display filter." value-name:"<displaY filter>"`
	CaptureFilter   string         `short:"f" description:"Apply capture filter." value-name:"<capture filter>"`
	TimestampFormat string         `` /* 239-byte string literal not displayed */
	PlatformSwitches
	Profile  string   `long:"profile" short:"C" description:"Start with this configuration profile." value-name:"<profile>"`
	PassThru string   `` /* 179-byte string literal not displayed */
	LogTty   bool     `long:"log-tty" optional:"true" optional-value:"true" choice:"true" choice:"false" description:"Log to the terminal."`
	Debug    TriState `` /* 158-byte string literal not displayed */
	Help     bool     `long:"help" short:"h" optional:"true" optional-value:"true" description:"Show this help message."`
	Version  []bool   `long:"version" short:"v" optional:"true" optional-value:"true" description:"Show version information."`

	Args struct {
		FilterOrPcap string `value-name:"<filter-or-file>" description:"Filter (capture for iface, display for pcap), or pcap to read."`
	} `positional-args:"yes"`
}

Termshark's own command line arguments. Used if we don't pass through to tshark.

type TriState

type TriState struct {
	Set bool
	Val bool
}

func (TriState) MarshalFlag

func (b TriState) MarshalFlag() string

func (*TriState) UnmarshalFlag

func (b *TriState) UnmarshalFlag(value string) error

type Tshark

type Tshark struct {
	PassThru    string `` /* 204-byte string literal not displayed */
	Profile     string `long:"profile" short:"C" description:"Start with this configuration profile." value-name:"<profile>"`
	PrintIfaces bool   `short:"D" optional:"true" optional-value:"true" description:"Print a list of the interfaces on which termshark can capture."`
	TailSwitch
}

Used to determine if we should run tshark instead e.g. stdout is not a tty

Jump to

Keyboard shortcuts

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