Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Format ¶
Format pretty-prints a shell program. It normalizes the input to a single line (via ImplodeSh), inserts line breaks at configured boundaries (via ExplodeSh), then re-indents and normalizes the result. && and || are moved to the next line with backslash continuation. When MaxWidth > 0 and the single-line command fits within it, binary operator breaks are skipped; clause breaks still apply.
Types ¶
type Config ¶
type Config struct {
BinCmd bool // break at pipes, &&, ||
Clause bool // break for/while/if/case clauses
MaxWidth int // max line width; binary operators are only broken when the single-line command exceeds this (0 = always break)
}
Config controls which structural boundaries get line breaks.
var Cfg Config
Cfg is the active configuration.
Click to show internal directories.
Click to hide internal directories.