Skip to content

feat(interpreter): implement bash/sh -e/-x/-u/-f/-o flags#270

Merged
chaliy merged 3 commits intomainfrom
claude/bashkit-bash-compatibility-BsDKD
Feb 25, 2026
Merged

feat(interpreter): implement bash/sh -e/-x/-u/-f/-o flags#270
chaliy merged 3 commits intomainfrom
claude/bashkit-bash-compatibility-BsDKD

Conversation

@chaliy
Copy link
Copy Markdown
Contributor

@chaliy chaliy commented Feb 25, 2026

Summary

  • Implements shell option flags for bash/sh re-invocation: -e, -x, -u, -f, -o option
  • Supports combined flags like -eu, -euxo pipefail
  • Options are saved/restored around subshell execution (no leaking to parent)
  • Adds -o with named options: errexit, nounset, xtrace, pipefail, noglob, noclobber, verbose
  • Invalid -o option name returns proper error

Test plan

  • 13 new spec tests covering each flag and combinations
  • All 1437 spec tests pass (1432 pass, 5 skip)
  • cargo clippy clean
  • cargo fmt clean
  • Existing bash-command tests still pass

Wire up shell option flags for bash/sh re-invocation:
- -e (errexit): exit on first failed command
- -x (xtrace): print commands before execution
- -u (nounset): error on unset variables
- -f (noglob): disable glob expansion
- -o option: set long options (errexit, nounset, xtrace, pipefail, etc.)
- Combined flags like -eu, -euxo pipefail

Options are saved/restored around subshell execution so they
don't leak into the parent shell.

Adds 13 spec tests for bash flag handling.

https://claude.ai/code/session_012rzB3FRw7yoQWCG1mxyW7J
@chaliy chaliy force-pushed the claude/bashkit-bash-compatibility-BsDKD branch from 9549f5c to cf9712e Compare February 25, 2026 14:42
@chaliy chaliy merged commit 76c9b11 into main Feb 25, 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