Skip to main content

Module bash

Module bash 

Source

Functionsยง

extract_bash_command
parse_shell_lc_plain_commands
Returns the sequence of plain commands within a bash -lc "..." or zsh -lc "..." invocation when the script only contains word-only commands joined by safe operators.
parse_shell_lc_single_command_prefix
Returns the parsed argv for a single shell command in a here-doc style script (<<), as long as the script contains exactly one command node.
parse_shell_script_into_commands
Parses a shell script consisting only of plain commands joined by safe operators.
try_parse_shell
Parse the provided bash source using tree-sitter-bash, returning a Tree on success or None if parsing failed.
try_parse_word_only_commands_sequence
Parse a script which may contain multiple simple commands joined only by the safe logical/pipe/sequencing operators: &&, ||, ;, |.