Skip to content

Add support for subshell functions#78

Open
jbrubake wants to merge 1 commit intoreconquest:masterfrom
jbrubake:detect-subshell-funcs
Open

Add support for subshell functions#78
jbrubake wants to merge 1 commit intoreconquest:masterfrom
jbrubake:detect-subshell-funcs

Conversation

@jbrubake
Copy link

Functions in the form func () ( ... ) are documented just like the more common {} version.

Functions in the form `func () ( ... )` are documented just like
the more common `{}` version.
# - `function_name () {`
# - `function_name {`
/^[[:blank:]]*(function[[:blank:]]+)?([a-zA-Z0-9_\-:-\\.]+)[[:blank:]]*(\([[:blank:]]*\))?[[:blank:]]*\{/ \
/^[[:blank:]]*(function[[:blank:]]+)?([a-zA-Z0-9_\-:-\\.]+)[[:blank:]]*(\([[:blank:]]*\))?[[:blank:]]*[({]/ \
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need to escape it?

/^[[:blank:]]*(function[[:blank:]]+)?([a-zA-Z0-9_\-:-\\.]+)[[:blank:]]*(\([[:blank:]]*\))?[[:blank:]]*[\{\(]/ \

Copy link
Author

@jbrubake jbrubake Feb 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quote the { and (? No, it's a bracket expression so they are treated literally. You can quote them if using gawk but I don't think that works as expected if using another awk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants