shlex

package module
v0.0.0-...-c80c9d0 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2020 License: BSD-3-Clause Imports: 1 Imported by: 2

README

go-shlex

CircleCI Go Report Card GoDoc

go-shlex is a POSIX command-line shell-like argument parser.

Differences
  • anmitsu/go-shlex: anmitsu does not support comments (#) and double-quoted dollar ($) and backtick (`) characters.

  • google/shlex: google does not support Unicode spaces and double-quoted newlines (\n) and backslashes (\). google also stops parsing upon error, while we (and anmitsu) will return partial results.

Documentation

Overview

Package shlex is a Unicode-supporting POSIX command-line argument parser.

shlex will parse for example

start --append="foobar foobaz" --nogood 'food'

into the appropriate argvs to start the command.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Split

func Split(s string) []string

Split splits a command line according to Bash shell rules.

Split is compatible with Bash quoting as described in https://www.gnu.org/software/bash/manual/html_node/Quoting.html and GRUB quoting as described in https://www.gnu.org/software/grub/manual/grub/grub.html#Quoting

Split treats $, ", \, \n, and ` as special within double quotes, as does Bash. This is slightly different from GRUB, but Grub can live with it.

Types

This section is empty.

Jump to

Keyboard shortcuts

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