Skip to main content

format_function_body_zsh

Function format_function_body_zsh 

Source
pub fn format_function_body_zsh(body: &str) -> String
Expand description

Format a function body the way zsh’s typeset -f / functions display it: each top-level statement on its own line (split on ; and \n), trailing semicolons stripped, no empty lines. Matches /bin/zsh -f -c 'f() { echo a; echo b; }; typeset -f f' output: f () { (tab)echo a (tab)echo b }