shellquote

package
v2.20.3 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var UnixEscape = regexp.MustCompile(`[^\w!%+,\-./:=@^]`)

Functions

func ShellArgsString

func ShellArgsString(args []string) string

func ShellString

func ShellString(exe string, args []string) string

func Split added in v2.7.3

func Split(line string) ([]string, error)

Split the given string into an array, using shell quote semantics.

func Unix added in v2.20.0

func Unix(arg string) string

Unix checks if the give string contains characters that have special meaning for a shell. If it does, it will be quoted using single quotes. If the string itself contains single quotes, then the string is split on single quotes, each single quote is escaped and each segment between the escaped single quotes is quoted separately.

func Windows added in v2.20.0

func Windows(arg string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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