• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

LICENSEH A D28-Apr-20181 KiB

READMEH A D28-Apr-20181.2 KiB

both_test.goH A D28-Apr-2018591

doc.goH A D28-Apr-2018118

quote.goH A D28-Apr-20182.3 KiB

quote_test.goH A D28-Apr-20181.1 KiB

unquote.goH A D28-Apr-20183.6 KiB

unquote_test.goH A D28-Apr-20181.9 KiB

README

1PACKAGE
2
3package shellquote
4    import "github.com/kballard/go-shellquote"
5
6    Shellquote provides utilities for joining/splitting strings using sh's
7    word-splitting rules.
8
9VARIABLES
10
11var (
12    UnterminatedSingleQuoteError = errors.New("Unterminated single-quoted string")
13    UnterminatedDoubleQuoteError = errors.New("Unterminated double-quoted string")
14    UnterminatedEscapeError      = errors.New("Unterminated backslash-escape")
15)
16
17
18FUNCTIONS
19
20func Join(args ...string) string
21    Join quotes each argument and joins them with a space. If passed to
22    /bin/sh, the resulting string will be split back into the original
23    arguments.
24
25func Split(input string) (words []string, err error)
26    Split splits a string according to /bin/sh's word-splitting rules. It
27    supports backslash-escapes, single-quotes, and double-quotes. Notably it
28    does not support the $'' style of quoting. It also doesn't attempt to
29    perform any other sort of expansion, including brace expansion, shell
30    expansion, or pathname expansion.
31
32    If the given input has an unterminated quoted string or ends in a
33    backslash-escape, one of UnterminatedSingleQuoteError,
34    UnterminatedDoubleQuoteError, or UnterminatedEscapeError is returned.
35
36
37