Skip to content

feat(builtins): implement printf %q shell quoting#263

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

feat(builtins): implement printf %q shell quoting#263
chaliy merged 1 commit intomainfrom
claude/bashkit-bash-compatibility-BsDKD

Conversation

@chaliy
Copy link
Contributor

@chaliy chaliy commented Feb 25, 2026

Summary

  • Implement printf %q format specifier for shell-safe string quoting
  • Matches bash behavior: backslash-escapes printable special chars, $'...' for control chars
  • 6 spec tests covering: spaces, simple strings, empty, special chars, tabs, single quotes

Test plan

  • cargo test --all-features passes
  • cargo clippy --all-targets --all-features -- -D warnings clean
  • cargo fmt --check clean
  • Spec counts updated (Bash 941→947, Total 1359→1365)

Matches bash behavior: backslash-escapes printable special chars,
uses $'...' quoting for control characters, leaves safe strings
unquoted, and quotes empty strings as ''.

https://claude.ai/code/session_012rzB3FRw7yoQWCG1mxyW7J
@chaliy chaliy merged commit f7c0f66 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