Skip to content

Fix ls audit findings: -n, -sl, multi-op, errors#27

Open
kelp wants to merge 1 commit intomainfrom
fix-ls-integration-tests
Open

Fix ls audit findings: -n, -sl, multi-op, errors#27
kelp wants to merge 1 commit intomainfrom
fix-ls-integration-tests

Conversation

@kelp
Copy link
Copy Markdown
Owner

@kelp kelp commented Mar 31, 2026

Summary

  • -n implies long format: -n now forces long format output, matching GNU spec ("like -l, but list numeric user and group IDs")
  • -sl per-entry block count: Long format with -s now shows per-entry block count before permissions; -k uses 1024-byte blocks throughout all display modes
  • Multi-operand file headers: File operands are listed without headers; only directory operands get dir: headers when mixed (GNU behavior)
  • POSIX error messages: Errors now use POSIX strings ("No such file or directory") instead of Zig error names ("error.FileNotFound")

Test plan

  • just it-util ls passes all 77 tests (0 failures)
  • zig build test passes (full unit test suite)
  • just fmt clean

Four fixes for ls integration test failures:

- -n implies long format (GNU: "like -l, but list numeric
  user and group IDs")
- -sl shows per-entry block count before permissions,
  -k uses 1024-byte blocks throughout
- Multi-operand: file operands listed without headers,
  directory operands get "dir:" headers (GNU behavior)
- Error messages use POSIX strings ("No such file or
  directory") instead of Zig error names
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.

1 participant