cli

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2026 License: MIT Imports: 16 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 Main

func Main(args []string) int

Main runs socat with the given args (excluding program name).

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
	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