cli

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2026 License: MIT Imports: 21 Imported by: 0

Documentation

Overview

Package cli implements the socat command-line interface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run added in v1.0.1

func Run(args []string, signalExit func(int)) int

Run runs socat with the given args (excluding program name). signalExit is owned by cmd/socat so tests can exercise signal handling without terminating the test process.

Types

type Config

type Config struct {
	Help          int // 0 none, 1 -h, 2 -hh, 3 -hhh
	Version       bool
	LogLevel      logx.Level
	LogFile       string
	Progname      string
	Micros        bool
	Hostname      bool
	Verbose       bool
	Hex           bool
	BlockSize     int
	Linger        time.Duration
	Idle          time.Duration // <0 infinite, 0 zero, >0 timeout
	IdleSet       bool
	LeftToRight   bool // -u
	RightToLeft   bool // -U
	IP4           bool
	IP6           bool
	IPAny         bool
	Statistics    bool
	Experimental  bool
	LockFile      string
	LockWait      string
	RawLeft       string // -r
	RawRight      string // -R
	SignalLogMask uint64 // -S: signals whose termination is logged
	Addresses     []string
}

Config holds parsed global options.

func ParseArgs

func ParseArgs(args []string) (*Config, error)

ParseArgs parses os.Args-style arguments (without program name).

Jump to

Keyboard shortcuts

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