(CommandList children: [ (FuncDef name: k_shell_doc body: (BraceGroup children: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:KOALEPHANT_TOOL_DESCRIPTION) op: Equal rhs: { (DQ ( "Generate Markdown documentation from a 'shelldoc' documented shell script" ) ) } spids: [56] ) ] spids: [54] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:KOALEPHANT_TOOL_VERSION) op: Equal rhs: {(DQ (1.0.0))} spids: [64] ) ] spids: [62] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:KOALEPHANT_TOOL_OPTIONS) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children: [ (SimpleCommand words: [{(cat)}] redirects: [ (HereDoc op: <Redir_DLessDash '<<-'> fd: 16777215 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') ] ) ] ) ] ) left_token: <Left_CommandSub '$('> spids: [74 91] ) ) } spids: [72] ) ] spids: [70] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:KOALEPHANT_TOOL_ARGUMENTS) op: Equal rhs: {(DQ (file))} spids: [98] ) ] spids: [96] ) (C {(.)} {(./base.lib.sh)}) (C {(.)} {(./string.lib.sh)}) (C {(.)} {(./bool.lib.sh)}) (C {(.)} {(./fs.lib.sh)}) (SimpleCommand words: [{(k_log_level)} {(${ VSub_Name KOALEPHANT_LOG_LEVEL_NOTICE)}] redirects: [(Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(/dev/null)})] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:TMP_FUNC_DESCRIPTION) op: Equal rhs: {(DQ (func-description))} spids: [140] ) ] spids: [138] ) (Assignment keyword: Assign_Readonly pairs: [(assign_pair lhs:(LhsName name:TMP_FUNC_DESCRIPTION) op:Equal spids:[148])] spids: [146] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:TMP_FUNC_INPUT) op: Equal rhs: {(DQ (func-input))} spids: [154] ) ] spids: [152] ) (Assignment keyword: Assign_Readonly pairs: [(assign_pair lhs:(LhsName name:TMP_FUNC_INPUT) op:Equal spids:[162])] spids: [160] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:TMP_FUNC_OUTPUT) op: Equal rhs: {(DQ (func-output))} spids: [168] ) ] spids: [166] ) (Assignment keyword: Assign_Readonly pairs: [(assign_pair lhs:(LhsName name:TMP_FUNC_OUTPUT) op:Equal spids:[176])] spids: [174] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:TMP_FUNC_RETURN) op: Equal rhs: {(DQ (func-return))} spids: [182] ) ] spids: [180] ) (Assignment keyword: Assign_Readonly pairs: [(assign_pair lhs:(LhsName name:TMP_FUNC_RETURN) op:Equal spids:[190])] spids: [188] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:TMP_FUNC_EXAMPLE) op: Equal rhs: {(DQ (func-example))} spids: [196] ) ] spids: [194] ) (Assignment keyword: Assign_Readonly pairs: [(assign_pair lhs:(LhsName name:TMP_FUNC_EXAMPLE) op:Equal spids:[204])] spids: [202] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:tmpDir) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children:[(C {(k_fs_temp_dir)})]) left_token: <Left_CommandSub '$('> spids: [212 214] ) ) } spids: [210] ) ] spids: [208] ) (Assignment keyword: Assign_Readonly pairs: [(assign_pair lhs:(LhsName name:tmpDir) op:Equal spids:[220])] spids: [218] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:newLineWSpace) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children:[(C {(printf)} {(SQ <'\\n '>)})]) left_token: <Left_CommandSub '$('> spids: [228 234] ) ) } spids: [226] ) ] spids: [224] ) (Assignment keyword: Assign_Readonly pairs: [(assign_pair lhs:(LhsName name:newLineWSpace) op:Equal spids:[240])] spids: [238] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:newLine) op: Equal rhs: { (DQ (BracedVarSub token: <VSub_Name newLineWSpace> suffix_op: (StringUnary op_id:VOp1_Percent arg_word:{(' ')}) spids: [248 252] ) ) } spids: [246] ) ] spids: [244] ) (Assignment keyword: Assign_Readonly pairs: [(assign_pair lhs:(LhsName name:newLine) op:Equal spids:[258])] spids: [256] ) (Assignment keyword: Assign_Local pairs: [(assign_pair lhs:(LhsName name:file) op:Equal rhs:{(DQ )} spids:[264])] spids: [262] ) (Assignment keyword: Assign_Local pairs: [(assign_pair lhs:(LhsName name:headerBlock) op:Equal rhs:{(DQ )} spids:[271])] spids: [269] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:headerDescription) op: Equal rhs: {(DQ )} spids: [278] ) ] spids: [276] ) (Assignment keyword: Assign_Local pairs: [(assign_pair lhs:(LhsName name:headerMode) op:Equal rhs:{(true)} spids:[285])] spids: [283] ) (Assignment keyword: Assign_Local pairs: [(assign_pair lhs:(LhsName name:funcMode) op:Equal rhs:{(false)} spids:[292])] spids: [290] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:functionSegment) op: Equal rhs: {(DQ (description))} spids: [298] ) ] spids: [296] ) (FuncDef name: tmp_string_file body: (BraceGroup children: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:name) op: Equal rhs: {(DQ ($ VSub_Number '$1'))} spids: [314] ) ] spids: [312] ) (C {(printf)} {(DQ ('%s/%s'))} {(DQ (${ VSub_Name tmpDir))} {(DQ (${ VSub_Name name))}) ] spids: [309] ) spids: [305 308] ) (FuncDef name: tmp_string_get body: (BraceGroup children: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:name) op: Equal rhs: {(DQ ($ VSub_Number '$1'))} spids: [352] ) ] spids: [350] ) (C {(cat)} { (DQ (CommandSubPart command_list: (CommandList children: [(C {(tmp_string_file)} {(DQ (${ VSub_Name name))})] ) left_token: <Left_CommandSub '$('> spids: [361 369] ) ) } ) ] spids: [347] ) spids: [343 346] ) (FuncDef name: tmp_string_append body: (BraceGroup children: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:name) op: Equal rhs: {(DQ ($ VSub_Number '$1'))} spids: [386] ) ] spids: [384] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:string) op: Equal rhs: {(DQ ($ VSub_Number '$2'))} spids: [394] ) ] spids: [392] ) (SimpleCommand words: [{(printf)} {(DQ ('%s') (Lit_Other '\\') (n))} {(DQ (${ VSub_Name string))}] redirects: [ (Redir op: <Redir_DGreat '>>'> fd: 16777215 arg_word: { (DQ (CommandSubPart command_list: (CommandList children: [(C {(tmp_string_file)} {(DQ (${ VSub_Name name))})] ) left_token: <Left_CommandSub '$('> spids: [417 425] ) ) } ) ] ) ] spids: [381] ) spids: [377 380] ) (FuncDef name: tmp_string_set body: (BraceGroup children: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:name) op: Equal rhs: {(DQ ($ VSub_Number '$1'))} spids: [442] ) ] spids: [440] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:string) op: Equal rhs: {(DQ ($ VSub_Number '$2'))} spids: [450] ) ] spids: [448] ) (SimpleCommand words: [{(printf)} {(DQ ('%s') (Lit_Other '\\') (n))} {(DQ (${ VSub_Name string))}] redirects: [ (Redir op: <Redir_Great '>'> fd: 16777215 arg_word: { (DQ (CommandSubPart command_list: (CommandList children: [(C {(tmp_string_file)} {(DQ (${ VSub_Name name))})] ) left_token: <Left_CommandSub '$('> spids: [473 481] ) ) } ) ] ) ] spids: [437] ) spids: [433 436] ) (FuncDef name: tmp_string_clear body: (BraceGroup children: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:name) op: Equal rhs: {(DQ ($ VSub_Number '$1'))} spids: [498] ) ] spids: [496] ) (SimpleCommand words: [{(printf)} {(DQ )}] redirects: [ (Redir op: <Redir_Great '>'> fd: 16777215 arg_word: { (DQ (CommandSubPart command_list: (CommandList children: [(C {(tmp_string_file)} {(DQ (${ VSub_Name name))})] ) left_token: <Left_CommandSub '$('> spids: [512 520] ) ) } ) ] ) ] spids: [493] ) spids: [489 492] ) (FuncDef name: tmp_string_exists body: (BraceGroup children: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:name) op: Equal rhs: {(DQ ($ VSub_Number '$1'))} spids: [537] ) ] spids: [535] ) (C {(Lit_Other '[')} {(-s)} { (DQ (CommandSubPart command_list: (CommandList children: [(C {(tmp_string_file)} {(DQ (${ VSub_Name name))})] ) left_token: <Left_CommandSub '$('> spids: [548 556] ) ) } {(Lit_Other ']')} ) ] spids: [532] ) spids: [528 531] ) (FuncDef name: add_header_property body: (BraceGroup children: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:name) op: Equal rhs: {(DQ ($ VSub_Number '$1'))} spids: [575] ) ] spids: [573] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:value) op: Equal rhs: {(DQ ($ VSub_Number '$2'))} spids: [583] ) ] spids: [581] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:line) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children: [ (C {(printf)} {(DQ ('%s: %s'))} {(DQ (${ VSub_Name name))} {(DQ (${ VSub_Name value))} ) ] ) left_token: <Left_CommandSub '$('> spids: [593 611] ) ) } spids: [591] ) ] spids: [589] ) (C {(k_log_info)} {(DQ ('Adding header property: ') (${ VSub_Name name))}) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} {(-n)} {(DQ (${ VSub_Name headerBlock))} {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:line) op: Equal rhs: {(DQ (${ VSub_Name newLine) (${ VSub_Name line))} spids: [644] ) ] spids: [644] ) ] spids: [16777215 641] ) ] spids: [16777215 655] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:headerBlock) op: Equal rhs: {(DQ (${ VSub_Name headerBlock) (${ VSub_Name line))} spids: [659] ) ] spids: [659] ) ] spids: [570] ) spids: [566 569] ) (FuncDef name: add_header_description body: (BraceGroup children: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:line) op: Equal rhs: {(DQ ($ VSub_Number '$1'))} spids: [683] ) ] spids: [681] ) (C {(k_log_info)} {(DQ ('Adding header description: ') (${ VSub_Name line))}) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} {(-n)} {(DQ (${ VSub_Name headerDescription))} {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:line) op: Equal rhs: {(DQ (${ VSub_Name newLineWSpace) (${ VSub_Name line))} spids: [718] ) ] spids: [718] ) ] spids: [16777215 715] ) ] spids: [16777215 729] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:headerDescription) op: Equal rhs: {(DQ (${ VSub_Name headerDescription) (${ VSub_Name line))} spids: [734] ) ] spids: [734] ) ] spids: [678] ) spids: [674 677] ) (FuncDef name: print_headers body: (BraceGroup children: [ (C {(add_header_property)} {(DQ (description))} {(DQ (${ VSub_Name headerDescription))} ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:block) op: Equal rhs: {(DQ (---))} spids: [771] ) ] spids: [769] ) (C {(printf)} { (DQ ('%s') (Lit_Other '\\') ('n%s') (Lit_Other '\\') ('n%s') (Lit_Other '\\') (n) (Lit_Other '\\') (n) ) } {(DQ (${ VSub_Name block))} {(DQ (${ VSub_Name headerBlock))} {(DQ (${ VSub_Name block))} ) ] spids: [753] ) spids: [749 752] ) (FuncDef name: parse_header_line body: (BraceGroup children: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:line) op: Equal rhs: {(DQ ($ VSub_Number '$1'))} spids: [823] ) (assign_pair lhs: (LhsName name:property) op: Equal spids: [828] ) (assign_pair lhs: (LhsName name:value) op: Equal spids: [830] ) ] spids: [821] ) (If arms: [ (if_arm cond: [ (Sentence child: (Pipeline children: [ (C {(k_string_starts_with)} {(DQ ('#'))} {(DQ (${ VSub_Name line))}) ] negated: T ) terminator: <Op_Semi ';'> ) ] action: [ (C {(k_log_info)} {(DQ ('End of file header detected'))}) (C {(print_headers)}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:headerMode) op: Equal rhs: {(false)} spids: [864] ) ] spids: [864] ) (ControlFlow token: <ControlFlow_Return return> ) ] spids: [16777215 851] ) ] spids: [16777215 871] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:line) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children: [ (C {(k_string_remove_start)} {(DQ ('#'))} {(DQ (${ VSub_Name line))} ) ] ) left_token: <Left_CommandSub '$('> spids: [877 889] ) ) } spids: [875] ) ] spids: [875] ) (Case to_match: {(DQ ($ VSub_Name '$line'))} arms: [ (case_arm pat_list: [ {(Lit_Other '@') (Ignore) (Lit_Other '*')} {(KW_Bang '!') (Lit_Other '*')} ] spids: [904 910 913 16777215] ) (case_arm pat_list: [{(Lit_Other '*') (Lit_Other ':') (Lit_Other '*')}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:property) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children: [ (C {(k_string_remove_end)} {(DQ (':*'))} {(DQ (${ VSub_Name line))} ) ] ) left_token: <Left_CommandSub '$('> spids: [925 937] ) ) } spids: [923] ) ] spids: [923] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:value) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children: [ (C {(k_string_trim)} { (DQ (CommandSubPart command_list: (CommandList children: [ (C {(k_string_remove_start)} {(DQ (${ VSub_Name property) (':'))} {(DQ (${ VSub_Name line))} ) ] ) left_token: <Left_CommandSub '$('> spids: [947 962] ) ) } ) ] ) left_token: <Left_CommandSub '$('> spids: [943 964] ) ) } spids: [941] ) ] spids: [941] ) (C {(add_header_property)} { (DQ (CommandSubPart command_list: (CommandList children: [ (C {(k_string_lower)} { (DQ (CommandSubPart command_list: (CommandList children: [ (C {(k_string_trim)} {(DQ (${ VSub_Name property))} ) ] ) left_token: <Left_CommandSub '$('> spids: [975 983] ) ) } ) ] ) left_token: <Left_CommandSub '$('> spids: [971 985] ) ) } {(DQ (${ VSub_Name value))} ) ] spids: [917 920 995 16777215] ) (case_arm pat_list: [{(Lit_Other '*')}] action: [ (C {(add_header_description)} { (DQ (CommandSubPart command_list: (CommandList children: [(C {(k_string_trim)} {(DQ ($ VSub_Name '$line'))})] ) left_token: <Left_CommandSub '$('> spids: [1006 1012] ) ) } ) ] spids: [999 1000 1016 16777215] ) ] spids: [894 900 1019] ) ] spids: [818] ) spids: [814 817] ) (FuncDef name: parse_function_input body: (BraceGroup children: [ (C {(tmp_string_append)} {(DQ (${ VSub_Name TMP_FUNC_INPUT))} { (DQ (CommandSubPart command_list: (CommandList children: [(C {(format_function_input)} {(DQ ($ VSub_Number '$1'))})] ) left_token: <Left_CommandSub '$('> spids: [1042 1048] ) ) } ) ] spids: [1030] ) spids: [1026 1029] ) (FuncDef name: parse_function_output body: (BraceGroup children: [ (C {(tmp_string_append)} {(DQ (${ VSub_Name TMP_FUNC_OUTPUT))} { (DQ (CommandSubPart command_list: (CommandList children: [(C {(k_string_trim)} {(DQ ($ VSub_Number '$1'))})] ) left_token: <Left_CommandSub '$('> spids: [1071 1077] ) ) } ) ] spids: [1059] ) spids: [1055 1058] ) (FuncDef name: parse_function_return body: (BraceGroup children: [ (C {(tmp_string_append)} {(DQ (${ VSub_Name TMP_FUNC_RETURN))} { (DQ (CommandSubPart command_list: (CommandList children: [(C {(k_string_trim)} {(DQ ($ VSub_Number '$1'))})] ) left_token: <Left_CommandSub '$('> spids: [1101 1107] ) ) } ) ] spids: [1089] ) spids: [1085 1088] ) (FuncDef name: parse_function_description body: (BraceGroup children: [ (C {(tmp_string_set)} {(DQ (${ VSub_Name TMP_FUNC_DESCRIPTION))} { (DQ (CommandSubPart command_list: (CommandList children: [ (C {(format_function_links)} { (DQ (CommandSubPart command_list: (CommandList children: [(C {(k_string_trim)} {(DQ (${ VSub_Number 1))})] ) left_token: <Left_CommandSub '$('> spids: [1135 1143] ) ) } ) ] ) left_token: <Left_CommandSub '$('> spids: [1131 1145] ) ) } ) ] spids: [1119] ) spids: [1115 1118] ) (FuncDef name: parse_function_example body: (BraceGroup children: [ (C {(tmp_string_append)} {(DQ (${ VSub_Name TMP_FUNC_EXAMPLE))} {(DQ ($ VSub_Number '$1'))} ) ] spids: [1157] ) spids: [1153 1156] ) (FuncDef name: format_function_input body: (BraceGroup children: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:line) op: Equal rhs: {(DQ ($ VSub_Number '$1'))} spids: [1186] ) ] spids: [1184] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:name) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children: [ (C {(k_string_remove_end)} {(DQ (' - *'))} {(DQ (${ VSub_Name line))} ) ] ) left_token: <Left_CommandSub '$('> spids: [1196 1208] ) ) } spids: [1194] ) ] spids: [1192] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:description) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children: [ (C {(k_string_trim)} { (DQ (CommandSubPart command_list: (CommandList children: [ (C {(k_string_remove_start)} {(DQ (${ VSub_Name name) (' - '))} {(DQ (${ VSub_Name line))} ) ] ) left_token: <Left_CommandSub '$('> spids: [1220 1235] ) ) } ) ] ) left_token: <Left_CommandSub '$('> spids: [1216 1237] ) ) } spids: [1214] ) ] spids: [1212] ) (C {(printf)} { (DQ (' * ') (EscapedLiteralPart token:<Lit_EscapedChar '\\`'>) ('%s') (EscapedLiteralPart token:<Lit_EscapedChar '\\`'>) (' - %s') (Lit_Other '\\') (n) ) } { (DQ (CommandSubPart command_list: (CommandList children: [(C {(k_string_trim)} {(DQ ($ VSub_Name '$name'))})] ) left_token: <Left_CommandSub '$('> spids: [1254 1260] ) ) } { (DQ (CommandSubPart command_list: (CommandList children: [ (C {(format_function_links)} {(DQ ($ VSub_Name '$description'))}) ] ) left_token: <Left_CommandSub '$('> spids: [1264 1270] ) ) } ) ] spids: [1181] ) spids: [1177 1180] ) (FuncDef name: format_function_links body: (BraceGroup children: [ (Pipeline children: [ (C {(printf)} {(DQ ('%s'))} {(DQ ($ VSub_Number '$1'))}) (C {(sed)} {(-E)} {(-e)} {(SQ <'s/\\(([^#]*)#([A-Za-z_]{1,})\\)/[`\\1\\2`](#\\2)/g'>)} ) ] negated: F ) ] spids: [1282] ) spids: [1278 1281] ) (FuncDef name: print_function_title body: (BraceGroup children: [ (C {(printf)} {(SQ <'### `%s` {#%s}\\n%s\\n\\n'>)} {(DQ ($ VSub_Number '$1'))} { (DQ (BracedVarSub token: <VSub_Number 2> suffix_op: (StringUnary op_id: VTest_ColonHyphen arg_word: {(${ VSub_Number 1)} ) spids: [1330 1336] ) ) } { (DQ (CommandSubPart command_list: (CommandList children: [ (C {(tmp_string_get)} {(DQ (${ VSub_Name TMP_FUNC_DESCRIPTION))}) ] ) left_token: <Left_CommandSub '$('> spids: [1340 1348] ) ) } ) ] spids: [1316] ) spids: [1312 1315] ) (FuncDef name: print_function_input body: (BraceGroup children: [ (If arms: [ (if_arm cond: [ (Sentence child: (C {(tmp_string_exists)} {(DQ (${ VSub_Name TMP_FUNC_INPUT))}) terminator: <Op_Semi ';'> ) ] action: [ (C {(printf)} {(SQ <'#### Input:\\n%s\\n\\n'>)} { (DQ (CommandSubPart command_list: (CommandList children: [ (C {(tmp_string_get)} {(DQ (${ VSub_Name TMP_FUNC_INPUT))}) ] ) left_token: <Left_CommandSub '$('> spids: [1384 1392] ) ) } ) ] spids: [16777215 1374] ) ] spids: [16777215 1396] ) ] spids: [1360] ) spids: [1356 1359] ) (FuncDef name: print_function_output body: (BraceGroup children: [ (If arms: [ (if_arm cond: [ (Sentence child: (C {(tmp_string_exists)} {(DQ (${ VSub_Name TMP_FUNC_OUTPUT))}) terminator: <Op_Semi ';'> ) ] action: [ (C {(printf)} {(SQ <'#### Output:\\n%s\\n\\n'>)} { (DQ (CommandSubPart command_list: (CommandList children: [ (C {(tmp_string_get)} {(DQ (${ VSub_Name TMP_FUNC_OUTPUT))}) ] ) left_token: <Left_CommandSub '$('> spids: [1431 1439] ) ) } ) ] spids: [16777215 1421] ) ] spids: [16777215 1443] ) ] spids: [1407] ) spids: [1403 1406] ) (FuncDef name: print_function_return body: (BraceGroup children: [ (If arms: [ (if_arm cond: [ (Sentence child: (C {(tmp_string_exists)} {(DQ (${ VSub_Name TMP_FUNC_RETURN))}) terminator: <Op_Semi ';'> ) ] action: [ (C {(printf)} {(SQ <'#### Return:\\n%s\\n\\n'>)} { (DQ (CommandSubPart command_list: (CommandList children: [ (C {(tmp_string_get)} {(DQ (${ VSub_Name TMP_FUNC_RETURN))}) ] ) left_token: <Left_CommandSub '$('> spids: [1478 1486] ) ) } ) ] spids: [16777215 1468] ) ] spids: [16777215 1490] ) ] spids: [1454] ) spids: [1450 1453] ) (FuncDef name: print_function_example body: (BraceGroup children: [ (If arms: [ (if_arm cond: [ (Sentence child: (C {(tmp_string_exists)} {(DQ (${ VSub_Name TMP_FUNC_EXAMPLE))}) terminator: <Op_Semi ';'> ) ] action: [ (C {(printf)} {(SQ <'#### Example:\\n~~~sh\\n%s\\n~~~\\n\\n'>)} { (DQ (CommandSubPart command_list: (CommandList children: [ (C {(tmp_string_get)} {(DQ (${ VSub_Name TMP_FUNC_EXAMPLE))}) ] ) left_token: <Left_CommandSub '$('> spids: [1525 1533] ) ) } ) ] spids: [16777215 1515] ) ] spids: [16777215 1537] ) ] spids: [1501] ) spids: [1497 1500] ) (FuncDef name: parse_body_line body: (BraceGroup children: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:line) op: Equal rhs: {(DQ ($ VSub_Number '$1'))} spids: [1553] ) ] spids: [1551] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:paddedLine) op: Equal rhs: {(DQ )} spids: [1561] ) ] spids: [1559] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} { (DQ (BracedVarSub token: <VSub_Name line> prefix_op: VSub_Pound spids: [1572 1575] ) ) } {(-eq)} {(0)} {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [(ControlFlow token:<ControlFlow_Return return>)] spids: [16777215 1585] ) ] spids: [16777215 1591] ) (If arms: [ (if_arm cond: [ (Sentence child: (Pipeline children: [ (C {(k_string_starts_with)} {(DQ ('#'))} {(DQ (${ VSub_Name line))}) ] negated: T ) terminator: <Op_Semi ';'> ) ] action: [ (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} {(${ VSub_Name funcMode)} {(KW_Bang '!') (Lit_Other '=')} {(true)} {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [(ControlFlow token:<ControlFlow_Return return>)] spids: [16777215 1631] ) ] spids: [16777215 1637] ) (Assignment keyword: Assign_Local pairs: [(assign_pair lhs:(LhsName name:name) op:Equal spids:[1643])] spids: [1641] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:doFuncBits) op: Equal rhs: {(false)} spids: [1648] ) ] spids: [1646] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:identifier) op: Equal rhs: {(DQ )} spids: [1654] ) ] spids: [1652] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(k_string_contains)} {(DQ ('()'))} {(DQ (${ VSub_Name line))}) terminator: <Op_Semi ';'> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:name) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children: [ (C {(k_string_remove_end)} {(DQ ('()*'))} {(DQ (${ VSub_Name line))} ) ] ) left_token: <Left_CommandSub '$('> spids: [1680 1692] ) ) } spids: [1678] ) ] spids: [1678] ) ] spids: [16777215 1675] ) ] else_action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:identifier) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children: [ (C {(k_string_remove_end)} {(DQ ('=*'))} {(DQ (${ VSub_Name line))} ) ] ) left_token: <Left_CommandSub '$('> spids: [1701 1713] ) ) } spids: [1699] ) ] spids: [1699] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:name) op: Equal rhs: { (DQ (EscapedLiteralPart token:<Lit_EscapedChar '\\$'>) (${ VSub_Name identifier) ) } spids: [1717] ) ] spids: [1717] ) ] spids: [1696 1726] ) (C {(print_function_title)} {(DQ (${ VSub_Name name))} {(DQ (${ VSub_Name identifier))} ) (C {(print_function_input)}) (C {(print_function_output)}) (C {(print_function_return)}) (C {(print_function_example)}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:funcMode) op: Equal rhs: {(false)} spids: [1758] ) ] spids: [1758] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:functionSegment) op: Equal rhs: {(description)} spids: [1762] ) ] spids: [1762] ) (C {(tmp_string_clear)} {(DQ (${ VSub_Name TMP_FUNC_DESCRIPTION))}) (C {(tmp_string_clear)} {(DQ (${ VSub_Name TMP_FUNC_INPUT))}) (C {(tmp_string_clear)} {(DQ (${ VSub_Name TMP_FUNC_OUTPUT))}) (C {(tmp_string_clear)} {(DQ (${ VSub_Name TMP_FUNC_RETURN))}) (C {(tmp_string_clear)} {(DQ (${ VSub_Name TMP_FUNC_EXAMPLE))}) ] spids: [16777215 1612] ) ] else_action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:funcMode) op: Equal rhs: {(true)} spids: [1816] ) ] spids: [1816] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:paddedLine) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children: [ (C {(k_string_remove_start)} {(DQ (Lit_Other '\\') ('#'))} {(DQ (${ VSub_Name line))} ) ] ) left_token: <Left_CommandSub '$('> spids: [1822 1835] ) ) } spids: [1820] ) ] spids: [1820] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:line) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children: [ (C {(k_string_trim)} {(DQ (${ VSub_Name paddedLine))}) ] ) left_token: <Left_CommandSub '$('> spids: [1841 1849] ) ) } spids: [1839] ) ] spids: [1839] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} { (DQ (BracedVarSub token: <VSub_Name line> prefix_op: VSub_Pound spids: [1859 1862] ) ) } {(-eq)} {(0)} {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [(ControlFlow token:<ControlFlow_Return return>)] spids: [16777215 1872] ) ] spids: [16777215 1878] ) (Case to_match: {(DQ (${ VSub_Name line))} arms: [ (case_arm pat_list: [ {(Lit_Other '@') (Ignore) (Lit_Other '*')} {(Lit_Other '@') (TODO) (Lit_Other '*')} {(Lit_Other '@') (Todo) (Lit_Other '*')} ] action: [(ControlFlow token:<ControlFlow_Return return>)] spids: [1893 1904 1910 16777215] ) (case_arm pat_list: [{(Input) (Lit_Other ':') (Lit_Other '*')}] action: [ (C {(tmp_string_clear)} {(DQ (${ VSub_Name TMP_FUNC_INPUT))}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:functionSegment) op: Equal rhs: {(input)} spids: [1929] ) ] spids: [1929] ) (ControlFlow token: <ControlFlow_Return return> ) ] spids: [1914 1917 1936 16777215] ) (case_arm pat_list: [{(Output) (Lit_Other ':') (Lit_Other '*')}] action: [ (C {(tmp_string_clear)} {(DQ (${ VSub_Name TMP_FUNC_OUTPUT))}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:functionSegment) op: Equal rhs: {(output)} spids: [1955] ) ] spids: [1955] ) (ControlFlow token: <ControlFlow_Return return> ) ] spids: [1940 1943 1962 16777215] ) (case_arm pat_list: [{(Return) (Lit_Other ':') (Lit_Other '*')}] action: [ (C {(tmp_string_clear)} {(DQ (${ VSub_Name TMP_FUNC_RETURN))}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:functionSegment) op: Equal rhs: {(ControlFlow_Return return)} spids: [1981] ) ] spids: [1981] ) (ControlFlow token: <ControlFlow_Return return> ) ] spids: [1966 1969 1988 16777215] ) (case_arm pat_list: [{(Example) (Lit_Other ':') (Lit_Other '*')}] action: [ (C {(tmp_string_clear)} {(DQ (${ VSub_Name TMP_FUNC_EXAMPLE))}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:functionSegment) op: Equal rhs: {(example)} spids: [2007] ) ] spids: [2007] ) (ControlFlow token: <ControlFlow_Return return> ) ] spids: [1992 1995 2014 16777215] ) ] spids: [1882 1890 2017] ) (C {(k_log_info)} { (DQ ('Found function segment type: ') (${ VSub_Name functionSegment) (" for '") (${ VSub_Name line) ("'") ) } ) (Case to_match: {(${ VSub_Name functionSegment)} arms: [ (case_arm pat_list: [{(description)}] action: [(C {(parse_function_description)} {(DQ (${ VSub_Name line))})] spids: [2045 2046 2058 16777215] ) (case_arm pat_list: [{(input)}] action: [(C {(parse_function_input)} {(DQ (${ VSub_Name line))})] spids: [2062 2063 2075 16777215] ) (case_arm pat_list: [{(output)}] action: [(C {(parse_function_output)} {(DQ (${ VSub_Name line))})] spids: [2079 2080 2092 16777215] ) (case_arm pat_list: [{(ControlFlow_Return return)}] action: [(C {(parse_function_return)} {(DQ (${ VSub_Name line))})] spids: [2096 2097 2109 16777215] ) (case_arm pat_list: [{(example)}] action: [ (C {(parse_function_example)} { (DQ (CommandSubPart command_list: (CommandList children: [ (C {(k_string_remove_start)} {(DQ (' '))} {(DQ (${ VSub_Name paddedLine))} ) ] ) left_token: <Left_CommandSub '$('> spids: [2120 2132] ) ) } ) ] spids: [2113 2114 2136 16777215] ) ] spids: [2036 2042 2139] ) ] spids: [1813 2142] ) ] spids: [1548] ) spids: [1544 1547] ) (FuncDef name: parse_file body: (BraceGroup children: [ (Assignment keyword: Assign_Local pairs: [(assign_pair lhs:(LhsName name:line) op:Equal spids:[2158])] spids: [2156] ) (C {(add_header_property)} {(title)} { (DQ (BracedVarSub token: <VSub_Name file> suffix_op: (StringUnary op_id:VOp1_DPound arg_word:{('*') (Lit_Slash /)}) spids: [2167 2172] ) ) } ) (WhileUntil keyword: <KW_While while> cond: [(Sentence child:(C {(read)} {(-r)} {(line)}) terminator:<Op_Semi ';'>)] body: (DoGroup children: [ (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} {(${ VSub_Name headerMode)} {(Lit_Other '=')} {(true)} {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [(C {(parse_header_line)} {(DQ (${ VSub_Name line))})] spids: [16777215 2204] ) ] else_action: [(C {(parse_body_line)} {(DQ (${ VSub_Name line))})] spids: [2216 2228] ) ] spids: [2186 2231] ) redirects: [ (Redir op: <Redir_Less '<'> fd: 16777215 arg_word: {(DQ (${ VSub_Name file))} ) ] ) ] spids: [2153] ) spids: [2149 2152] ) (WhileUntil keyword: <KW_While while> cond: [ (Sentence child: (C {(Lit_Other '[')} {($ VSub_Pound '$#')} {(-gt)} {(0)} {(Lit_Other ']')}) terminator: <Op_Semi ';'> ) ] body: (DoGroup children: [ (Case to_match: {(DQ ($ VSub_Number '$1'))} arms: [ (case_arm pat_list: [{(-h)} {(--help)}] action: [(C {(k_usage)}) (ControlFlow token:<ControlFlow_Exit exit>)] spids: [2273 2276 2285 16777215] ) (case_arm pat_list: [{(-V)} {(--verbose)}] action: [ (SimpleCommand words: [{(k_log_level)} {(${ VSub_Name KOALEPHANT_LOG_LEVEL_INFO)}] redirects: [ (Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(/dev/null)} ) ] ) (C {(shift)}) ] spids: [2289 2292 2309 16777215] ) (case_arm pat_list: [{(-D)} {(--debug)}] action: [ (SimpleCommand words: [{(k_log_level)} {(${ VSub_Name KOALEPHANT_LOG_LEVEL_DEBUG)}] redirects: [ (Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(/dev/null)} ) ] ) (C {(shift)}) ] spids: [2313 2316 2333 16777215] ) (case_arm pat_list: [{(-q)} {(--quiet)}] action: [ (SimpleCommand words: [{(k_log_level)} {(${ VSub_Name KOALEPHANT_LOG_LEVEL_ERR)}] redirects: [ (Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(/dev/null)} ) ] ) (C {(shift)}) ] spids: [2337 2340 2357 16777215] ) (case_arm pat_list: [{(-v)} {(--version)}] action: [(C {(k_version)}) (ControlFlow token:<ControlFlow_Return return>)] spids: [2361 2364 2373 16777215] ) (case_arm pat_list: [{(-) (Lit_Other '*')}] action: [ (C {(k_log_err)} {(DQ ('Unknown option: ') (${ VSub_Number 1))}) (C {(k_usage)}) (ControlFlow token: <ControlFlow_Return return> arg_word: {(1)} ) ] spids: [2377 2379 2400 16777215] ) (case_arm pat_list: [{(--)}] action: [(C {(shift)}) (ControlFlow token:<ControlFlow_Break break>)] spids: [2404 2405 2414 16777215] ) (case_arm pat_list: [{(Lit_Other '*')}] action: [(ControlFlow token:<ControlFlow_Break break>)] spids: [2418 2419 2425 16777215] ) ] spids: [2263 2269 2428] ) ] spids: [2260 2431] ) ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} {(-z)} { (DQ (BracedVarSub token: <VSub_Number 1> suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(EmptyPart)}) spids: [2442 2445] ) ) } {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (C {(k_log_err)} {(DQ ('No file specified'))}) (C {(k_usage)}) (ControlFlow token:<ControlFlow_Return return> arg_word:{(1)}) ] spids: [16777215 2451] ) ] spids: [16777215 2469] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:file) op: Equal rhs: {(DQ ($ VSub_Number '$1'))} spids: [2473] ) ] spids: [2473] ) (C {(parse_file)}) (C {(k_fs_temp_cleanup)}) ] spids: [50] ) spids: [46 49] ) (C {(k_shell_doc)} {(DQ ($ VSub_At '$@'))}) ] )