(command.CommandList children: [ (command.ShFunction name: k_shell_doc body: (BraceGroup children: [ (C {<local>} {<Id.Lit_VarLike 'KOALEPHANT_TOOL_DESCRIPTION='> (DQ <'Generate Markdown documentation from a \'shelldoc\' documented shell script'>) } ) (C {<local>} {<Id.Lit_VarLike 'KOALEPHANT_TOOL_VERSION='> (DQ <1.0.0>)}) (C {<local>} {<Id.Lit_VarLike 'KOALEPHANT_TOOL_OPTIONS='> (DQ (command_sub left_token: <Id.Left_DollarParen '$('> child: (command.Simple words: [{<cat>}] redirects: [ (redir op: <Id.Redir_DLessDash '<<-'> loc: (redir_loc.Fd fd:0) arg: (redir_param.HereDoc here_begin: {<EOT>} here_end_span_id: 89 stdin_parts: [ <'Options:\n'> <'\n'> <' -h, --help show this help\n'> <' -v, --version show the version\n'> <' -V, --verbose show verbose output\n'> <' -D, --debug show debug output\n'> <' -q, --quiet suppress all output except errors\n'> <'\n'> ] ) ) ] do_fork: T ) ) ) } ) (C {<local>} {<Id.Lit_VarLike 'KOALEPHANT_TOOL_ARGUMENTS='> (DQ <file>)}) (C {<.>} {<'./base.lib.sh'>}) (C {<.>} {<'./string.lib.sh'>}) (C {<.>} {<'./bool.lib.sh'>}) (C {<.>} {<'./fs.lib.sh'>}) (command.Simple words: [{<k_log_level>} {(${ Id.VSub_Name KOALEPHANT_LOG_LEVEL_NOTICE)}] redirects: [(redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<'/dev/null'>})] do_fork: T ) (C {<local>} {<Id.Lit_VarLike 'TMP_FUNC_DESCRIPTION='> (DQ <func-description>)}) (C {<readonly>} {<TMP_FUNC_DESCRIPTION>}) (C {<local>} {<Id.Lit_VarLike 'TMP_FUNC_INPUT='> (DQ <func-input>)}) (C {<readonly>} {<TMP_FUNC_INPUT>}) (C {<local>} {<Id.Lit_VarLike 'TMP_FUNC_OUTPUT='> (DQ <func-output>)}) (C {<readonly>} {<TMP_FUNC_OUTPUT>}) (C {<local>} {<Id.Lit_VarLike 'TMP_FUNC_RETURN='> (DQ <func-return>)}) (C {<readonly>} {<TMP_FUNC_RETURN>}) (C {<local>} {<Id.Lit_VarLike 'TMP_FUNC_EXAMPLE='> (DQ <func-example>)}) (C {<readonly>} {<TMP_FUNC_EXAMPLE>}) (C {<local>} {<Id.Lit_VarLike 'tmpDir='> (DQ (command_sub left_token:<Id.Left_DollarParen '$('> child:(C {<k_fs_temp_dir>}))) } ) (C {<readonly>} {<tmpDir>}) (C {<local>} {<Id.Lit_VarLike 'newLineWSpace='> (DQ (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<printf>} {(SQ <'\\n '>)}) ) ) } ) (C {<readonly>} {<newLineWSpace>}) (C {<local>} {<Id.Lit_VarLike 'newLine='> (DQ (braced_var_sub token: <Id.VSub_Name newLineWSpace> suffix_op: (suffix_op.Unary tok:<Id.VOp1_Percent '%'> arg_word:{<' '>}) ) ) } ) (C {<readonly>} {<newLine>}) (C {<local>} {<Id.Lit_VarLike 'file='> (DQ )}) (C {<local>} {<Id.Lit_VarLike 'headerBlock='> (DQ )}) (C {<local>} {<Id.Lit_VarLike 'headerDescription='> (DQ )}) (C {<local>} {<Id.Lit_VarLike 'headerMode='> <true>}) (C {<local>} {<Id.Lit_VarLike 'funcMode='> <false>}) (C {<local>} {<Id.Lit_VarLike 'functionSegment='> (DQ <description>)}) (command.ShFunction name: tmp_string_file body: (BraceGroup children: [ (C {<local>} {<Id.Lit_VarLike 'name='> (DQ ($ Id.VSub_Number '$1'))}) (C {<printf>} {(DQ <'%s/%s'>)} {(DQ (${ Id.VSub_Name tmpDir))} {(DQ (${ Id.VSub_Name name))} ) ] ) ) (command.ShFunction name: tmp_string_get body: (BraceGroup children: [ (C {<local>} {<Id.Lit_VarLike 'name='> (DQ ($ Id.VSub_Number '$1'))}) (C {<cat>} { (DQ (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<tmp_string_file>} {(DQ (${ Id.VSub_Name name))}) ) ) } ) ] ) ) (command.ShFunction name: tmp_string_append body: (BraceGroup children: [ (C {<local>} {<Id.Lit_VarLike 'name='> (DQ ($ Id.VSub_Number '$1'))}) (C {<local>} {<Id.Lit_VarLike 'string='> (DQ ($ Id.VSub_Number '$2'))}) (command.Simple words: [ {<printf>} {(DQ <'%s'> <Id.Lit_BadBackslash '\\'> <n>)} {(DQ (${ Id.VSub_Name string))} ] redirects: [ (redir op: <Id.Redir_DGreat '>>'> loc: (redir_loc.Fd fd:1) arg: { (DQ (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<tmp_string_file>} {(DQ (${ Id.VSub_Name name))}) ) ) } ) ] do_fork: T ) ] ) ) (command.ShFunction name: tmp_string_set body: (BraceGroup children: [ (C {<local>} {<Id.Lit_VarLike 'name='> (DQ ($ Id.VSub_Number '$1'))}) (C {<local>} {<Id.Lit_VarLike 'string='> (DQ ($ Id.VSub_Number '$2'))}) (command.Simple words: [ {<printf>} {(DQ <'%s'> <Id.Lit_BadBackslash '\\'> <n>)} {(DQ (${ Id.VSub_Name string))} ] redirects: [ (redir op: <Id.Redir_Great '>'> loc: (redir_loc.Fd fd:1) arg: { (DQ (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<tmp_string_file>} {(DQ (${ Id.VSub_Name name))}) ) ) } ) ] do_fork: T ) ] ) ) (command.ShFunction name: tmp_string_clear body: (BraceGroup children: [ (C {<local>} {<Id.Lit_VarLike 'name='> (DQ ($ Id.VSub_Number '$1'))}) (command.Simple words: [{<printf>} {(DQ )}] redirects: [ (redir op: <Id.Redir_Great '>'> loc: (redir_loc.Fd fd:1) arg: { (DQ (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<tmp_string_file>} {(DQ (${ Id.VSub_Name name))}) ) ) } ) ] do_fork: T ) ] ) ) (command.ShFunction name: tmp_string_exists body: (BraceGroup children: [ (C {<local>} {<Id.Lit_VarLike 'name='> (DQ ($ Id.VSub_Number '$1'))}) (C {<Id.Lit_LBracket '['>} {<-s>} { (DQ (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<tmp_string_file>} {(DQ (${ Id.VSub_Name name))}) ) ) } {<Id.Lit_RBracket ']'>} ) ] ) ) (command.ShFunction name: add_header_property body: (BraceGroup children: [ (C {<local>} {<Id.Lit_VarLike 'name='> (DQ ($ Id.VSub_Number '$1'))}) (C {<local>} {<Id.Lit_VarLike 'value='> (DQ ($ Id.VSub_Number '$2'))}) (C {<local>} {<Id.Lit_VarLike 'line='> (DQ (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<printf>} {(DQ <'%s: %s'>)} {(DQ (${ Id.VSub_Name name))} {(DQ (${ Id.VSub_Name value))} ) ) ) } ) (C {<k_log_info>} {(DQ <'Adding header property: '> (${ Id.VSub_Name name))}) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {<-n>} {(DQ (${ Id.VSub_Name headerBlock))} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] ) action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:line) op: assign_op.Equal rhs: {(DQ (${ Id.VSub_Name newLine) (${ Id.VSub_Name line))} spids: [644] ) ] ) ] spids: [626 641] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:headerBlock) op: assign_op.Equal rhs: {(DQ (${ Id.VSub_Name headerBlock) (${ Id.VSub_Name line))} spids: [659] ) ] ) ] ) ) (command.ShFunction name: add_header_description body: (BraceGroup children: [ (C {<local>} {<Id.Lit_VarLike 'line='> (DQ ($ Id.VSub_Number '$1'))}) (C {<k_log_info>} {(DQ <'Adding header description: '> (${ Id.VSub_Name line))}) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {<-n>} {(DQ (${ Id.VSub_Name headerDescription))} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] ) action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:line) op: assign_op.Equal rhs: {(DQ (${ Id.VSub_Name newLineWSpace) (${ Id.VSub_Name line))} spids: [718] ) ] ) ] spids: [700 715] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:headerDescription) op: assign_op.Equal rhs: {(DQ (${ Id.VSub_Name headerDescription) (${ Id.VSub_Name line))} spids: [734] ) ] ) ] ) ) (command.ShFunction name: print_headers body: (BraceGroup children: [ (C {<add_header_property>} {(DQ <description>)} {(DQ (${ Id.VSub_Name headerDescription))} ) (C {<local>} {<Id.Lit_VarLike 'block='> (DQ <--->)}) (C {<printf>} { (DQ <'%s'> <Id.Lit_BadBackslash '\\'> <'n%s'> <Id.Lit_BadBackslash '\\'> <'n%s'> <Id.Lit_BadBackslash '\\'> <n> <Id.Lit_BadBackslash '\\'> <n> ) } {(DQ (${ Id.VSub_Name block))} {(DQ (${ Id.VSub_Name headerBlock))} {(DQ (${ Id.VSub_Name block))} ) ] ) ) (command.ShFunction name: parse_header_line body: (BraceGroup children: [ (C {<local>} {<Id.Lit_VarLike 'line='> (DQ ($ Id.VSub_Number '$1'))} {<property>} {<value>} ) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (command.Pipeline children: [ (C {<k_string_starts_with>} {(DQ <'#'>)} {(DQ (${ Id.VSub_Name line))} ) ] negated: T ) terminator: <Id.Op_Semi _> ) ] ) action: [ (C {<k_log_info>} {(DQ <'End of file header detected'>)}) (C {<print_headers>}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:headerMode) op: assign_op.Equal rhs: {<false>} spids: [864] ) ] ) (command.ControlFlow token: <Id.ControlFlow_Return return> ) ] spids: [834 851] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:line) op: assign_op.Equal rhs: { (DQ (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<k_string_remove_start>} {(DQ <'#'>)} {(DQ (${ Id.VSub_Name line))} ) ) ) } spids: [875] ) ] ) (command.Case to_match: {(DQ ($ Id.VSub_DollarName '$line'))} arms: [ (case_arm pat_list: [ {<Id.Lit_Splice '@Ignore'> <Id.Lit_Star '*'>} {<Id.KW_Bang '!'> <Id.Lit_Star '*'>} ] spids: [904 909 912 -1] ) (case_arm pat_list: [{<Id.Lit_Star '*'> <Id.Lit_Colon ':'> <Id.Lit_Star '*'>}] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:property) op: assign_op.Equal rhs: { (DQ (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<k_string_remove_end>} {(DQ <':*'>)} {(DQ (${ Id.VSub_Name line))} ) ) ) } spids: [922] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:value) op: assign_op.Equal rhs: { (DQ (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<k_string_trim>} { (DQ (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<k_string_remove_start>} {(DQ (${ Id.VSub_Name property) <':'>)} {(DQ (${ Id.VSub_Name line))} ) ) ) } ) ) ) } spids: [940] ) ] ) (C {<add_header_property>} { (DQ (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<k_string_lower>} { (DQ (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<k_string_trim>} {(DQ (${ Id.VSub_Name property))}) ) ) } ) ) ) } {(DQ (${ Id.VSub_Name value))} ) ] spids: [916 919 994 -1] ) (case_arm pat_list: [{<Id.Lit_Star '*'>}] action: [ (C {<add_header_description>} { (DQ (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<k_string_trim>} {(DQ ($ Id.VSub_DollarName '$line'))}) ) ) } ) ] spids: [998 999 1015 -1] ) ] ) ] ) ) (command.ShFunction name: parse_function_input body: (BraceGroup children: [ (C {<tmp_string_append>} {(DQ (${ Id.VSub_Name TMP_FUNC_INPUT))} { (DQ (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<format_function_input>} {(DQ ($ Id.VSub_Number '$1'))}) ) ) } ) ] ) ) (command.ShFunction name: parse_function_output body: (BraceGroup children: [ (C {<tmp_string_append>} {(DQ (${ Id.VSub_Name TMP_FUNC_OUTPUT))} { (DQ (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<k_string_trim>} {(DQ ($ Id.VSub_Number '$1'))}) ) ) } ) ] ) ) (command.ShFunction name: parse_function_return body: (BraceGroup children: [ (C {<tmp_string_append>} {(DQ (${ Id.VSub_Name TMP_FUNC_RETURN))} { (DQ (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<k_string_trim>} {(DQ ($ Id.VSub_Number '$1'))}) ) ) } ) ] ) ) (command.ShFunction name: parse_function_description body: (BraceGroup children: [ (C {<tmp_string_set>} {(DQ (${ Id.VSub_Name TMP_FUNC_DESCRIPTION))} { (DQ (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<format_function_links>} { (DQ (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<k_string_trim>} {(DQ (${ Id.VSub_Number 1))}) ) ) } ) ) ) } ) ] ) ) (command.ShFunction name: parse_function_example body: (BraceGroup children: [ (C {<tmp_string_append>} {(DQ (${ Id.VSub_Name TMP_FUNC_EXAMPLE))} {(DQ ($ Id.VSub_Number '$1'))} ) ] ) ) (command.ShFunction name: format_function_input body: (BraceGroup children: [ (C {<local>} {<Id.Lit_VarLike 'line='> (DQ ($ Id.VSub_Number '$1'))}) (C {<local>} {<Id.Lit_VarLike 'name='> (DQ (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<k_string_remove_end>} {(DQ <' - *'>)} {(DQ (${ Id.VSub_Name line))}) ) ) } ) (C {<local>} {<Id.Lit_VarLike 'description='> (DQ (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<k_string_trim>} { (DQ (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<k_string_remove_start>} {(DQ (${ Id.VSub_Name name) <' - '>)} {(DQ (${ Id.VSub_Name line))} ) ) ) } ) ) ) } ) (C {<printf>} { (DQ <' * '> (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\`'>) <'%s'> (word_part.EscapedLiteral token: <Id.Lit_EscapedChar '\\`'> ) <' - %s'> <Id.Lit_BadBackslash '\\'> <n> ) } { (DQ (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<k_string_trim>} {(DQ ($ Id.VSub_DollarName '$name'))}) ) ) } { (DQ (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<format_function_links>} {(DQ ($ Id.VSub_DollarName '$description'))}) ) ) } ) ] ) ) (command.ShFunction name: format_function_links body: (BraceGroup children: [ (command.Pipeline children: [ (C {<printf>} {(DQ <'%s'>)} {(DQ ($ Id.VSub_Number '$1'))}) (C {<sed>} {<-E>} {<-e>} {(SQ <'s/\\(([^#]*)#([A-Za-z_]{1,})\\)/[`\\1\\2`](#\\2)/g'>)} ) ] negated: F ) ] ) ) (command.ShFunction name: print_function_title body: (BraceGroup children: [ (C {<printf>} {(SQ <'### `%s` {#%s}\\n%s\\n\\n'>)} {(DQ ($ Id.VSub_Number '$1'))} { (DQ (braced_var_sub token: <Id.VSub_Number 2> suffix_op: (suffix_op.Unary tok: <Id.VTest_ColonHyphen ':-'> arg_word: {(${ Id.VSub_Number 1)} ) ) ) } { (DQ (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<tmp_string_get>} {(DQ (${ Id.VSub_Name TMP_FUNC_DESCRIPTION))}) ) ) } ) ] ) ) (command.ShFunction name: print_function_input body: (BraceGroup children: [ (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (C {<tmp_string_exists>} {(DQ (${ Id.VSub_Name TMP_FUNC_INPUT))}) terminator: <Id.Op_Semi _> ) ] ) action: [ (C {<printf>} {(SQ <'#### Input:\\n%s\\n\\n'>)} { (DQ (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<tmp_string_get>} {(DQ (${ Id.VSub_Name TMP_FUNC_INPUT))}) ) ) } ) ] spids: [1362 1373] ) ] ) ] ) ) (command.ShFunction name: print_function_output body: (BraceGroup children: [ (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (C {<tmp_string_exists>} {(DQ (${ Id.VSub_Name TMP_FUNC_OUTPUT))}) terminator: <Id.Op_Semi _> ) ] ) action: [ (C {<printf>} {(SQ <'#### Output:\\n%s\\n\\n'>)} { (DQ (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<tmp_string_get>} {(DQ (${ Id.VSub_Name TMP_FUNC_OUTPUT))}) ) ) } ) ] spids: [1409 1420] ) ] ) ] ) ) (command.ShFunction name: print_function_return body: (BraceGroup children: [ (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (C {<tmp_string_exists>} {(DQ (${ Id.VSub_Name TMP_FUNC_RETURN))}) terminator: <Id.Op_Semi _> ) ] ) action: [ (C {<printf>} {(SQ <'#### Return:\\n%s\\n\\n'>)} { (DQ (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<tmp_string_get>} {(DQ (${ Id.VSub_Name TMP_FUNC_RETURN))}) ) ) } ) ] spids: [1456 1467] ) ] ) ] ) ) (command.ShFunction name: print_function_example body: (BraceGroup children: [ (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (C {<tmp_string_exists>} {(DQ (${ Id.VSub_Name TMP_FUNC_EXAMPLE))}) terminator: <Id.Op_Semi _> ) ] ) action: [ (C {<printf>} {(SQ <'#### Example:\\n~~~sh\\n%s\\n~~~\\n\\n'>)} { (DQ (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<tmp_string_get>} {(DQ (${ Id.VSub_Name TMP_FUNC_EXAMPLE))}) ) ) } ) ] spids: [1503 1514] ) ] ) ] ) ) (command.ShFunction name: parse_body_line body: (BraceGroup children: [ (C {<local>} {<Id.Lit_VarLike 'line='> (DQ ($ Id.VSub_Number '$1'))}) (C {<local>} {<Id.Lit_VarLike 'paddedLine='> (DQ )}) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} { (DQ (braced_var_sub token: <Id.VSub_Name line> prefix_op: (Id.VSub_Pound) ) ) } {<-eq>} {<0>} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] ) action: [(command.ControlFlow token:<Id.ControlFlow_Return return>)] spids: [1566 1584] ) ] ) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (command.Pipeline children: [ (C {<k_string_starts_with>} {(DQ <'#'>)} {(DQ (${ Id.VSub_Name line))} ) ] negated: T ) terminator: <Id.Op_Semi _> ) ] ) action: [ (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {(${ Id.VSub_Name funcMode)} {<Id.KW_Bang '!'> <Id.Lit_Equals '='>} {<true>} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] ) action: [(command.ControlFlow token:<Id.ControlFlow_Return return>)] spids: [1614 1630] ) ] ) (C {<local>} {<name>}) (C {<local>} {<Id.Lit_VarLike 'doFuncBits='> <false>}) (C {<local>} {<Id.Lit_VarLike 'identifier='> (DQ )}) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (C {<k_string_contains>} {(DQ <'()'>)} {(DQ (${ Id.VSub_Name line))} ) terminator: <Id.Op_Semi _> ) ] ) action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:name) op: assign_op.Equal rhs: { (DQ (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<k_string_remove_end>} {(DQ <'()*'>)} {(DQ (${ Id.VSub_Name line))} ) ) ) } spids: [1677] ) ] ) ] spids: [1659 1674] ) ] else_action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:identifier) op: assign_op.Equal rhs: { (DQ (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<k_string_remove_end>} {(DQ <'=*'>)} {(DQ (${ Id.VSub_Name line))} ) ) ) } spids: [1698] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:name) op: assign_op.Equal rhs: { (DQ (word_part.EscapedLiteral token: <Id.Lit_EscapedChar '\\$'> ) (${ Id.VSub_Name identifier) ) } spids: [1716] ) ] ) ] ) (C {<print_function_title>} {(DQ (${ Id.VSub_Name name))} {(DQ (${ Id.VSub_Name identifier))} ) (C {<print_function_input>}) (C {<print_function_output>}) (C {<print_function_return>}) (C {<print_function_example>}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:funcMode) op: assign_op.Equal rhs: {<false>} spids: [1757] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:functionSegment) op: assign_op.Equal rhs: {<description>} spids: [1761] ) ] ) (C {<tmp_string_clear>} {(DQ (${ Id.VSub_Name TMP_FUNC_DESCRIPTION))}) (C {<tmp_string_clear>} {(DQ (${ Id.VSub_Name TMP_FUNC_INPUT))}) (C {<tmp_string_clear>} {(DQ (${ Id.VSub_Name TMP_FUNC_OUTPUT))}) (C {<tmp_string_clear>} {(DQ (${ Id.VSub_Name TMP_FUNC_RETURN))}) (C {<tmp_string_clear>} {(DQ (${ Id.VSub_Name TMP_FUNC_EXAMPLE))}) ] spids: [1594 1611] ) ] else_action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:funcMode) op: assign_op.Equal rhs: {<true>} spids: [1815] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:paddedLine) op: assign_op.Equal rhs: { (DQ (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<k_string_remove_start>} {(DQ <Id.Lit_BadBackslash '\\'> <'#'>)} {(DQ (${ Id.VSub_Name line))} ) ) ) } spids: [1819] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:line) op: assign_op.Equal rhs: { (DQ (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<k_string_trim>} {(DQ (${ Id.VSub_Name paddedLine))}) ) ) } spids: [1838] ) ] ) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} { (DQ (braced_var_sub token: <Id.VSub_Name line> prefix_op: (Id.VSub_Pound) ) ) } {<-eq>} {<0>} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] ) action: [(command.ControlFlow token:<Id.ControlFlow_Return return>)] spids: [1853 1871] ) ] ) (command.Case to_match: {(DQ (${ Id.VSub_Name line))} arms: [ (case_arm pat_list: [ {<Id.Lit_Splice '@Ignore'> <Id.Lit_Star '*'>} {<Id.Lit_Splice '@TODO'> <Id.Lit_Star '*'>} {<Id.Lit_Splice '@Todo'> <Id.Lit_Star '*'>} ] action: [(command.ControlFlow token:<Id.ControlFlow_Return return>)] spids: [1892 1900 1906 -1] ) (case_arm pat_list: [{<Input> <Id.Lit_Colon ':'> <Id.Lit_Star '*'>}] action: [ (C {<tmp_string_clear>} {(DQ (${ Id.VSub_Name TMP_FUNC_INPUT))}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:functionSegment) op: assign_op.Equal rhs: {<input>} spids: [1925] ) ] ) (command.ControlFlow token: <Id.ControlFlow_Return return> ) ] spids: [1910 1913 1932 -1] ) (case_arm pat_list: [{<Output> <Id.Lit_Colon ':'> <Id.Lit_Star '*'>}] action: [ (C {<tmp_string_clear>} {(DQ (${ Id.VSub_Name TMP_FUNC_OUTPUT))}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:functionSegment) op: assign_op.Equal rhs: {<output>} spids: [1951] ) ] ) (command.ControlFlow token: <Id.ControlFlow_Return return> ) ] spids: [1936 1939 1958 -1] ) (case_arm pat_list: [{<Return> <Id.Lit_Colon ':'> <Id.Lit_Star '*'>}] action: [ (C {<tmp_string_clear>} {(DQ (${ Id.VSub_Name TMP_FUNC_RETURN))}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:functionSegment) op: assign_op.Equal rhs: {<Id.ControlFlow_Return return>} spids: [1977] ) ] ) (command.ControlFlow token: <Id.ControlFlow_Return return> ) ] spids: [1962 1965 1984 -1] ) (case_arm pat_list: [{<Example> <Id.Lit_Colon ':'> <Id.Lit_Star '*'>}] action: [ (C {<tmp_string_clear>} {(DQ (${ Id.VSub_Name TMP_FUNC_EXAMPLE))}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:functionSegment) op: assign_op.Equal rhs: {<example>} spids: [2003] ) ] ) (command.ControlFlow token: <Id.ControlFlow_Return return> ) ] spids: [1988 1991 2010 -1] ) ] ) (C {<k_log_info>} { (DQ <'Found function segment type: '> (${ Id.VSub_Name functionSegment) <' for \''> (${ Id.VSub_Name line) <'\''> ) } ) (command.Case to_match: {(${ Id.VSub_Name functionSegment)} arms: [ (case_arm pat_list: [{<description>}] action: [(C {<parse_function_description>} {(DQ (${ Id.VSub_Name line))})] spids: [2041 2042 2054 -1] ) (case_arm pat_list: [{<input>}] action: [(C {<parse_function_input>} {(DQ (${ Id.VSub_Name line))})] spids: [2058 2059 2071 -1] ) (case_arm pat_list: [{<output>}] action: [(C {<parse_function_output>} {(DQ (${ Id.VSub_Name line))})] spids: [2075 2076 2088 -1] ) (case_arm pat_list: [{<Id.ControlFlow_Return return>}] action: [(C {<parse_function_return>} {(DQ (${ Id.VSub_Name line))})] spids: [2092 2093 2105 -1] ) (case_arm pat_list: [{<example>}] action: [ (C {<parse_function_example>} { (DQ (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<k_string_remove_start>} {(DQ <' '>)} {(DQ (${ Id.VSub_Name paddedLine))} ) ) ) } ) ] spids: [2109 2110 2132 -1] ) ] ) ] ) ] ) ) (command.ShFunction name: parse_file body: (BraceGroup children: [ (C {<local>} {<line>}) (C {<add_header_property>} {<title>} { (DQ (braced_var_sub token: <Id.VSub_Name file> suffix_op: (suffix_op.Unary tok: <Id.VOp1_DPound '##'> arg_word: {<Id.Lit_Other '*'> <Id.Lit_Slash '/'>} ) ) ) } ) (command.WhileUntil keyword: <Id.KW_While while> cond: (condition.Shell commands: [ (command.Sentence child: (C {<read>} {<-r>} {<line>}) terminator: <Id.Op_Semi _> ) ] ) body: (command.DoGroup children: [ (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {(${ Id.VSub_Name headerMode)} {<Id.Lit_Equals '='>} {<true>} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] ) action: [(C {<parse_header_line>} {(DQ (${ Id.VSub_Name line))})] spids: [2185 2200] ) ] else_action: [(C {<parse_body_line>} {(DQ (${ Id.VSub_Name line))})] ) ] ) redirects: [ (redir op: <Id.Redir_Less '<'> loc: (redir_loc.Fd fd:0) arg: {(DQ (${ Id.VSub_Name file))} ) ] ) ] ) ) (command.WhileUntil keyword: <Id.KW_While while> cond: (condition.Shell commands: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {($ Id.VSub_Pound '$#')} {<-gt>} {<0>} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] ) body: (command.DoGroup children: [ (command.Case to_match: {(DQ ($ Id.VSub_Number '$1'))} arms: [ (case_arm pat_list: [{<-h>} {<--help>}] action: [ (C {<k_usage>}) (command.ControlFlow token: <Id.ControlFlow_Exit exit> ) ] spids: [2269 2272 2281 -1] ) (case_arm pat_list: [{<-V>} {<--verbose>}] action: [ (command.Simple words: [{<k_log_level>} {(${ Id.VSub_Name KOALEPHANT_LOG_LEVEL_INFO)}] redirects: [ (redir op: <Id.Redir_Great '>'> loc: (redir_loc.Fd fd:1) arg: {<'/dev/null'>} ) ] do_fork: T ) (C {<shift>}) ] spids: [2285 2288 2305 -1] ) (case_arm pat_list: [{<-D>} {<--debug>}] action: [ (command.Simple words: [{<k_log_level>} {(${ Id.VSub_Name KOALEPHANT_LOG_LEVEL_DEBUG)}] redirects: [ (redir op: <Id.Redir_Great '>'> loc: (redir_loc.Fd fd:1) arg: {<'/dev/null'>} ) ] do_fork: T ) (C {<shift>}) ] spids: [2309 2312 2329 -1] ) (case_arm pat_list: [{<-q>} {<--quiet>}] action: [ (command.Simple words: [{<k_log_level>} {(${ Id.VSub_Name KOALEPHANT_LOG_LEVEL_ERR)}] redirects: [ (redir op: <Id.Redir_Great '>'> loc: (redir_loc.Fd fd:1) arg: {<'/dev/null'>} ) ] do_fork: T ) (C {<shift>}) ] spids: [2333 2336 2353 -1] ) (case_arm pat_list: [{<-v>} {<--version>}] action: [ (C {<k_version>}) (command.ControlFlow token: <Id.ControlFlow_Return return> ) ] spids: [2357 2360 2369 -1] ) (case_arm pat_list: [{<-> <Id.Lit_Star '*'>}] action: [ (C {<k_log_err>} {(DQ <'Unknown option: '> (${ Id.VSub_Number 1))}) (C {<k_usage>}) (command.ControlFlow token: <Id.ControlFlow_Return return> arg_word: {<1>} ) ] spids: [2373 2375 2396 -1] ) (case_arm pat_list: [{<-->}] action: [ (C {<shift>}) (command.ControlFlow token: <Id.ControlFlow_Break break> ) ] spids: [2400 2401 2410 -1] ) (case_arm pat_list: [{<Id.Lit_Star '*'>}] action: [(command.ControlFlow token:<Id.ControlFlow_Break break>)] spids: [2414 2415 2421 -1] ) ] ) ] ) ) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {<-z>} { (DQ (braced_var_sub token: <Id.VSub_Number 1> suffix_op: (suffix_op.Unary tok:<Id.VTest_ColonHyphen ':-'> arg_word:(word.Empty)) ) ) } {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] ) action: [ (C {<k_log_err>} {(DQ <'No file specified'>)}) (C {<k_usage>}) (command.ControlFlow token: <Id.ControlFlow_Return return> arg_word: {<1>} ) ] spids: [2431 2447] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:file) op: assign_op.Equal rhs: {(DQ ($ Id.VSub_Number '$1'))} spids: [2469] ) ] ) (C {<parse_file>}) (C {<k_fs_temp_cleanup>}) ] ) ) (C {<k_shell_doc>} {(DQ ($ Id.VSub_At '$@'))}) ] )