(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_id: Redir_DLessDash fd: 16777215 body: { (DQ ('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_expansion: True here_end: EOT was_filled: True spids: [77] ) ] ) ] ) left_token: <Left_CommandSub '$('> spids: [74 90] ) ) } spids: [72] ) ] spids: [70] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:KOALEPHANT_TOOL_ARGUMENTS) op: Equal rhs: {(DQ (file))} spids: [97] ) ] spids: [95] ) (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_id:Redir_Great fd:16777215 arg_word:{(/dev/null)} spids:[131])] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:TMP_FUNC_DESCRIPTION) op: Equal rhs: {(DQ (func-description))} spids: [139] ) ] spids: [137] ) (Assignment keyword: Assign_Readonly pairs: [(assign_pair lhs:(LhsName name:TMP_FUNC_DESCRIPTION) op:Equal spids:[147])] spids: [145] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:TMP_FUNC_INPUT) op: Equal rhs: {(DQ (func-input))} spids: [153] ) ] spids: [151] ) (Assignment keyword: Assign_Readonly pairs: [(assign_pair lhs:(LhsName name:TMP_FUNC_INPUT) op:Equal spids:[161])] spids: [159] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:TMP_FUNC_OUTPUT) op: Equal rhs: {(DQ (func-output))} spids: [167] ) ] spids: [165] ) (Assignment keyword: Assign_Readonly pairs: [(assign_pair lhs:(LhsName name:TMP_FUNC_OUTPUT) op:Equal spids:[175])] spids: [173] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:TMP_FUNC_RETURN) op: Equal rhs: {(DQ (func-return))} spids: [181] ) ] spids: [179] ) (Assignment keyword: Assign_Readonly pairs: [(assign_pair lhs:(LhsName name:TMP_FUNC_RETURN) op:Equal spids:[189])] spids: [187] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:TMP_FUNC_EXAMPLE) op: Equal rhs: {(DQ (func-example))} spids: [195] ) ] spids: [193] ) (Assignment keyword: Assign_Readonly pairs: [(assign_pair lhs:(LhsName name:TMP_FUNC_EXAMPLE) op:Equal spids:[203])] spids: [201] ) (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: [211 213] ) ) } spids: [209] ) ] spids: [207] ) (Assignment keyword: Assign_Readonly pairs: [(assign_pair lhs:(LhsName name:tmpDir) op:Equal spids:[219])] spids: [217] ) (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: [227 233] ) ) } spids: [225] ) ] spids: [223] ) (Assignment keyword: Assign_Readonly pairs: [(assign_pair lhs:(LhsName name:newLineWSpace) op:Equal spids:[239])] spids: [237] ) (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: [247 251] ) ) } spids: [245] ) ] spids: [243] ) (Assignment keyword: Assign_Readonly pairs: [(assign_pair lhs:(LhsName name:newLine) op:Equal spids:[257])] spids: [255] ) (Assignment keyword: Assign_Local pairs: [(assign_pair lhs:(LhsName name:file) op:Equal rhs:{(DQ )} spids:[263])] spids: [261] ) (Assignment keyword: Assign_Local pairs: [(assign_pair lhs:(LhsName name:headerBlock) op:Equal rhs:{(DQ )} spids:[270])] spids: [268] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:headerDescription) op: Equal rhs: {(DQ )} spids: [277] ) ] spids: [275] ) (Assignment keyword: Assign_Local pairs: [(assign_pair lhs:(LhsName name:headerMode) op:Equal rhs:{(true)} spids:[284])] spids: [282] ) (Assignment keyword: Assign_Local pairs: [(assign_pair lhs:(LhsName name:funcMode) op:Equal rhs:{(false)} spids:[291])] spids: [289] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:functionSegment) op: Equal rhs: {(DQ (description))} spids: [297] ) ] spids: [295] ) (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: [313] ) ] spids: [311] ) (C {(printf)} {(DQ ('%s/%s'))} {(DQ (${ VSub_Name tmpDir))} {(DQ (${ VSub_Name name))}) ] spids: [308] ) spids: [304 307] ) (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: [351] ) ] spids: [349] ) (C {(cat)} { (DQ (CommandSubPart command_list: (CommandList children: [(C {(tmp_string_file)} {(DQ (${ VSub_Name name))})] ) left_token: <Left_CommandSub '$('> spids: [360 368] ) ) } ) ] spids: [346] ) spids: [342 345] ) (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: [385] ) ] spids: [383] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:string) op: Equal rhs: {(DQ ($ VSub_Number '$2'))} spids: [393] ) ] spids: [391] ) (SimpleCommand words: [{(printf)} {(DQ ('%s') (Lit_Other '\\') (n))} {(DQ (${ VSub_Name string))}] redirects: [ (Redir op_id: 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: [416 424] ) ) } spids: [413] ) ] ) ] spids: [380] ) spids: [376 379] ) (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: [441] ) ] spids: [439] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:string) op: Equal rhs: {(DQ ($ VSub_Number '$2'))} spids: [449] ) ] spids: [447] ) (SimpleCommand words: [{(printf)} {(DQ ('%s') (Lit_Other '\\') (n))} {(DQ (${ VSub_Name string))}] redirects: [ (Redir op_id: 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: [472 480] ) ) } spids: [469] ) ] ) ] spids: [436] ) spids: [432 435] ) (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: [497] ) ] spids: [495] ) (SimpleCommand words: [{(printf)} {(DQ )}] redirects: [ (Redir op_id: 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: [511 519] ) ) } spids: [508] ) ] ) ] spids: [492] ) spids: [488 491] ) (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: [536] ) ] spids: [534] ) (C {(Lit_Other '[')} {(-s)} { (DQ (CommandSubPart command_list: (CommandList children: [(C {(tmp_string_file)} {(DQ (${ VSub_Name name))})] ) left_token: <Left_CommandSub '$('> spids: [547 555] ) ) } {(Lit_Other ']')} ) ] spids: [531] ) spids: [527 530] ) (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: [574] ) ] spids: [572] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:value) op: Equal rhs: {(DQ ($ VSub_Number '$2'))} spids: [582] ) ] spids: [580] ) (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: [592 610] ) ) } spids: [590] ) ] spids: [588] ) (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: [643] ) ] spids: [643] ) ] spids: [16777215 640] ) ] spids: [16777215 654] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:headerBlock) op: Equal rhs: {(DQ (${ VSub_Name headerBlock) (${ VSub_Name line))} spids: [658] ) ] spids: [658] ) ] spids: [569] ) spids: [565 568] ) (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: [682] ) ] spids: [680] ) (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: [717] ) ] spids: [717] ) ] spids: [16777215 714] ) ] spids: [16777215 728] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:headerDescription) op: Equal rhs: {(DQ (${ VSub_Name headerDescription) (${ VSub_Name line))} spids: [733] ) ] spids: [733] ) ] spids: [677] ) spids: [673 676] ) (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: [770] ) ] spids: [768] ) (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: [752] ) spids: [748 751] ) (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: [822] ) (assign_pair lhs: (LhsName name:property) op: Equal spids: [827] ) (assign_pair lhs: (LhsName name:value) op: Equal spids: [829] ) ] spids: [820] ) (If arms: [ (if_arm cond: [ (Sentence child: (Pipeline children: [ (C {(k_string_starts_with)} {(DQ ('#'))} {(DQ (${ VSub_Name line))}) ] negated: True ) 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: [863] ) ] spids: [863] ) (ControlFlow token: <ControlFlow_Return return> ) ] spids: [16777215 850] ) ] spids: [16777215 870] ) (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: [876 888] ) ) } spids: [874] ) ] spids: [874] ) (Case to_match: {(DQ ($ VSub_Name '$line'))} arms: [ (case_arm pat_list: [ {(Lit_Other '@') (Ignore) (Lit_Other '*')} {(KW_Bang '!') (Lit_Other '*')} ] spids: [903 909 912 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: [924 936] ) ) } spids: [922] ) ] spids: [922] ) (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: [946 961] ) ) } ) ] ) left_token: <Left_CommandSub '$('> spids: [942 963] ) ) } spids: [940] ) ] spids: [940] ) (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: [974 982] ) ) } ) ] ) left_token: <Left_CommandSub '$('> spids: [970 984] ) ) } {(DQ (${ VSub_Name value))} ) ] spids: [916 919 994 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: [1005 1011] ) ) } ) ] spids: [998 999 1015 16777215] ) ] spids: [893 899 1018] ) ] spids: [817] ) spids: [813 816] ) (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: [1041 1047] ) ) } ) ] spids: [1029] ) spids: [1025 1028] ) (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: [1070 1076] ) ) } ) ] spids: [1058] ) spids: [1054 1057] ) (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: [1100 1106] ) ) } ) ] spids: [1088] ) spids: [1084 1087] ) (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: [1134 1142] ) ) } ) ] ) left_token: <Left_CommandSub '$('> spids: [1130 1144] ) ) } ) ] spids: [1118] ) spids: [1114 1117] ) (FuncDef name: parse_function_example body: (BraceGroup children: [ (C {(tmp_string_append)} {(DQ (${ VSub_Name TMP_FUNC_EXAMPLE))} {(DQ ($ VSub_Number '$1'))} ) ] spids: [1156] ) spids: [1152 1155] ) (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: [1185] ) ] spids: [1183] ) (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: [1195 1207] ) ) } spids: [1193] ) ] spids: [1191] ) (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: [1219 1234] ) ) } ) ] ) left_token: <Left_CommandSub '$('> spids: [1215 1236] ) ) } spids: [1213] ) ] spids: [1211] ) (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: [1253 1259] ) ) } { (DQ (CommandSubPart command_list: (CommandList children: [ (C {(format_function_links)} {(DQ ($ VSub_Name '$description'))}) ] ) left_token: <Left_CommandSub '$('> spids: [1263 1269] ) ) } ) ] spids: [1180] ) spids: [1176 1179] ) (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: False ) ] spids: [1281] ) spids: [1277 1280] ) (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: [1329 1335] ) ) } { (DQ (CommandSubPart command_list: (CommandList children: [ (C {(tmp_string_get)} {(DQ (${ VSub_Name TMP_FUNC_DESCRIPTION))}) ] ) left_token: <Left_CommandSub '$('> spids: [1339 1347] ) ) } ) ] spids: [1315] ) spids: [1311 1314] ) (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: [1383 1391] ) ) } ) ] spids: [16777215 1373] ) ] spids: [16777215 1395] ) ] spids: [1359] ) spids: [1355 1358] ) (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: [1430 1438] ) ) } ) ] spids: [16777215 1420] ) ] spids: [16777215 1442] ) ] spids: [1406] ) spids: [1402 1405] ) (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: [1477 1485] ) ) } ) ] spids: [16777215 1467] ) ] spids: [16777215 1489] ) ] spids: [1453] ) spids: [1449 1452] ) (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: [1524 1532] ) ) } ) ] spids: [16777215 1514] ) ] spids: [16777215 1536] ) ] spids: [1500] ) spids: [1496 1499] ) (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: [1552] ) ] spids: [1550] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:paddedLine) op: Equal rhs: {(DQ )} spids: [1560] ) ] spids: [1558] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} { (DQ (BracedVarSub token: <VSub_Name line> prefix_op: VSub_Pound spids: [1571 1574] ) ) } {(-eq)} {(0)} {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [(ControlFlow token:<ControlFlow_Return return>)] spids: [16777215 1584] ) ] spids: [16777215 1590] ) (If arms: [ (if_arm cond: [ (Sentence child: (Pipeline children: [ (C {(k_string_starts_with)} {(DQ ('#'))} {(DQ (${ VSub_Name line))}) ] negated: True ) 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 1630] ) ] spids: [16777215 1636] ) (Assignment keyword: Assign_Local pairs: [(assign_pair lhs:(LhsName name:name) op:Equal spids:[1642])] spids: [1640] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:doFuncBits) op: Equal rhs: {(false)} spids: [1647] ) ] spids: [1645] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:identifier) op: Equal rhs: {(DQ )} spids: [1653] ) ] spids: [1651] ) (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: [1679 1691] ) ) } spids: [1677] ) ] spids: [1677] ) ] spids: [16777215 1674] ) ] 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: [1700 1712] ) ) } spids: [1698] ) ] spids: [1698] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:name) op: Equal rhs: { (DQ (EscapedLiteralPart token:<Lit_EscapedChar '\\$'>) (${ VSub_Name identifier) ) } spids: [1716] ) ] spids: [1716] ) ] spids: [1695 1725] ) (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: [1757] ) ] spids: [1757] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:functionSegment) op: Equal rhs: {(description)} spids: [1761] ) ] spids: [1761] ) (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 1611] ) ] else_action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:funcMode) op: Equal rhs: {(true)} spids: [1815] ) ] spids: [1815] ) (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: [1821 1834] ) ) } spids: [1819] ) ] spids: [1819] ) (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: [1840 1848] ) ) } spids: [1838] ) ] spids: [1838] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} { (DQ (BracedVarSub token: <VSub_Name line> prefix_op: VSub_Pound spids: [1858 1861] ) ) } {(-eq)} {(0)} {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [(ControlFlow token:<ControlFlow_Return return>)] spids: [16777215 1871] ) ] spids: [16777215 1877] ) (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: [1892 1903 1909 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: [1928] ) ] spids: [1928] ) (ControlFlow token: <ControlFlow_Return return> ) ] spids: [1913 1916 1935 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: [1954] ) ] spids: [1954] ) (ControlFlow token: <ControlFlow_Return return> ) ] spids: [1939 1942 1961 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: [1980] ) ] spids: [1980] ) (ControlFlow token: <ControlFlow_Return return> ) ] spids: [1965 1968 1987 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: [2006] ) ] spids: [2006] ) (ControlFlow token: <ControlFlow_Return return> ) ] spids: [1991 1994 2013 16777215] ) ] spids: [1881 1889 2016] ) (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: [2044 2045 2057 16777215] ) (case_arm pat_list: [{(input)}] action: [(C {(parse_function_input)} {(DQ (${ VSub_Name line))})] spids: [2061 2062 2074 16777215] ) (case_arm pat_list: [{(output)}] action: [(C {(parse_function_output)} {(DQ (${ VSub_Name line))})] spids: [2078 2079 2091 16777215] ) (case_arm pat_list: [{(ControlFlow_Return return)}] action: [(C {(parse_function_return)} {(DQ (${ VSub_Name line))})] spids: [2095 2096 2108 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: [2119 2131] ) ) } ) ] spids: [2112 2113 2135 16777215] ) ] spids: [2035 2041 2138] ) ] spids: [1812 2141] ) ] spids: [1547] ) spids: [1543 1546] ) (FuncDef name: parse_file body: (BraceGroup children: [ (Assignment keyword: Assign_Local pairs: [(assign_pair lhs:(LhsName name:line) op:Equal spids:[2157])] spids: [2155] ) (C {(add_header_property)} {(title)} { (DQ (BracedVarSub token: <VSub_Name file> suffix_op: (StringUnary op_id:VOp1_DPound arg_word:{('*') (Lit_Slash /)}) spids: [2166 2171] ) ) } ) (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 2203] ) ] else_action: [(C {(parse_body_line)} {(DQ (${ VSub_Name line))})] spids: [2215 2227] ) ] spids: [2185 2230] ) redirects: [ (Redir op_id: Redir_Less fd: 16777215 arg_word: {(DQ (${ VSub_Name file))} spids: [2232] ) ] ) ] spids: [2152] ) spids: [2148 2151] ) (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)}) (C {(exit)})] spids: [2272 2275 2284 16777215] ) (case_arm pat_list: [{(-V)} {(--verbose)}] action: [ (SimpleCommand words: [{(k_log_level)} {(${ VSub_Name KOALEPHANT_LOG_LEVEL_INFO)}] redirects: [ (Redir op_id: Redir_Great fd: 16777215 arg_word: {(/dev/null)} spids: [2300] ) ] ) (C {(shift)}) ] spids: [2288 2291 2308 16777215] ) (case_arm pat_list: [{(-D)} {(--debug)}] action: [ (SimpleCommand words: [{(k_log_level)} {(${ VSub_Name KOALEPHANT_LOG_LEVEL_DEBUG)}] redirects: [ (Redir op_id: Redir_Great fd: 16777215 arg_word: {(/dev/null)} spids: [2324] ) ] ) (C {(shift)}) ] spids: [2312 2315 2332 16777215] ) (case_arm pat_list: [{(-q)} {(--quiet)}] action: [ (SimpleCommand words: [{(k_log_level)} {(${ VSub_Name KOALEPHANT_LOG_LEVEL_ERR)}] redirects: [ (Redir op_id: Redir_Great fd: 16777215 arg_word: {(/dev/null)} spids: [2348] ) ] ) (C {(shift)}) ] spids: [2336 2339 2356 16777215] ) (case_arm pat_list: [{(-v)} {(--version)}] action: [(C {(k_version)}) (ControlFlow token:<ControlFlow_Return return>)] spids: [2360 2363 2372 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: [2376 2378 2399 16777215] ) (case_arm pat_list: [{(--)}] action: [(C {(shift)}) (ControlFlow token:<ControlFlow_Break break>)] spids: [2403 2404 2413 16777215] ) (case_arm pat_list: [{(Lit_Other '*')}] action: [(ControlFlow token:<ControlFlow_Break break>)] spids: [2417 2418 2424 16777215] ) ] spids: [2262 2268 2427] ) ] spids: [2259 2430] ) ) (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:{(SQ )}) spids: [2441 2444] ) ) } {(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 2450] ) ] spids: [16777215 2468] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:file) op: Equal rhs: {(DQ ($ VSub_Number '$1'))} spids: [2472] ) ] spids: [2472] ) (C {(parse_file)}) (C {(k_fs_temp_cleanup)}) ] spids: [50] ) spids: [46 49] ) (C {(k_shell_doc)} {(DQ ($ VSub_At '$@'))}) ] )