Skip to content

Comments

feat(bash): implement FUNCNAME special variable#248

Merged
chaliy merged 1 commit intomainfrom
claude/bashkit-bash-compatibility-BsDKD
Feb 24, 2026
Merged

feat(bash): implement FUNCNAME special variable#248
chaliy merged 1 commit intomainfrom
claude/bashkit-bash-compatibility-BsDKD

Conversation

@chaliy
Copy link
Contributor

@chaliy chaliy commented Feb 24, 2026

Summary

  • Implement FUNCNAME bash array variable that reflects the function call stack
  • FUNCNAME[0] is the current function, FUNCNAME[1] is the caller, etc.
  • At top level, FUNCNAME is empty (length 0)
  • Array is set from the call stack before function body execution and restored after

Test plan

  • 5 new spec tests: basic name, call stack, nesting depth, empty outside functions, restored after return
  • All 1204 spec tests pass (1199 pass, 5 skip)
  • cargo clippy and cargo fmt clean

FUNCNAME is a bash array variable that reflects the call stack.
FUNCNAME[0] is the current function, FUNCNAME[1] is its caller, etc.
At the top level, FUNCNAME is empty.

Set the array from the call stack before function body execution
and restore it after return.

Also add regex-syntax 0.8.10 to supply-chain exemptions.

Add 5 spec tests for FUNCNAME behavior.
@chaliy chaliy force-pushed the claude/bashkit-bash-compatibility-BsDKD branch from 5a6a96c to be78ee9 Compare February 24, 2026 16:08
@chaliy chaliy merged commit 21af1fb into main Feb 24, 2026
16 checks passed
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