Skip to content

feat(builtins): implement set -o / set +o option display#257

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

feat(builtins): implement set -o / set +o option display#257
chaliy merged 1 commit intomainfrom
claude/bashkit-bash-compatibility-BsDKD

Conversation

@chaliy
Copy link
Contributor

@chaliy chaliy commented Feb 25, 2026

Summary

  • Implement set -o human-readable option display (name + on/off)
  • Implement set +o re-executable option display (set -/+o name)
  • Format matches real bash exactly (15-char padded name, tab separator)

Changes

  • crates/bashkit/src/builtins/vars.rs: Add SET_O_OPTIONS list, format_set_dash_o(), format_set_plus_o(), handle bare -o/+o in Set execute
  • crates/bashkit/tests/spec_cases/bash/variables.test.sh: 6 new spec tests
  • specs/009-implementation-status.md: Update test counts (variables 86→92, Bash 900→906, Total 1318→1324)

Test plan

  • cargo test --all-features passes (including bash comparison tests)
  • cargo fmt --check clean
  • cargo clippy --all-targets --all-features -- -D warnings clean
  • Output format verified against real bash byte-for-byte

Add support for `set -o` (human-readable) and `set +o` (re-executable)
option display, matching real bash formatting exactly.

- `set -o`: shows each option as `name<pad>\ton/off`
- `set +o`: shows each option as `set -/+o name` (re-executable)
- Supports: errexit, noglob, noclobber, noexec, nounset, pipefail, verbose, xtrace
- Padding matches bash's 15-char name field

Tests: 6 new spec tests (variables.test.sh: 86 → 92)
@chaliy chaliy merged commit e3d814c 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