Documentation
¶
Index ¶
- func Args(words []*syntax.Word) ([]string, bool)
- func EnvArgs(args []*syntax.Word) ([]*syntax.Word, string)
- func Heredoc(redirect *syntax.Redirect, partial bool) (string, bool)
- func InterpreterIdentity(interpreter string) string
- func IsBatch(input string) bool
- func IsDigits(value string) bool
- func Literal(word *syntax.Word) (string, bool)
- func LiteralParts(parts []syntax.WordPart, quoted bool) bool
- func Operand(word *syntax.Word) (value string, glob bool, ok bool)
- func Quote(value string) string
- func QuoteArgument(value string) string
- func Split(input string) ([]string, error)
- func SplitSource(input string) []string
- func StatementSource(stmt *syntax.Stmt, fallback string) string
- type HeaderError
- type Parsed
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InterpreterIdentity ¶
InterpreterIdentity normalizes an interpreter path for policy comparisons.
func QuoteArgument ¶ added in v0.3.0
func Split ¶
Split starts programs at column-zero interpreter headers outside shell constructs. Headers stay with their programs; all other source bytes remain unchanged. Only an omitted params directive inherits the preceding complete object.
func SplitSource ¶
SplitSource returns authored program slices without validating headers or expanding inherited directives. It is also suitable for unfinished display input.
Types ¶
type HeaderError ¶
HeaderError locates a rejected header in the submitted program. Line is one-based and counts CRLF as one line terminator, just like header parsing.
func (*HeaderError) Error ¶
func (e *HeaderError) Error() string
func (*HeaderError) Unwrap ¶
func (e *HeaderError) Unwrap() error
Click to show internal directories.
Click to hide internal directories.