Skip to content

fix(date): implement -r flag for file modification time#1141

Merged
chaliy merged 1 commit intomainfrom
fix/issue-1113-date-r
Apr 7, 2026
Merged

fix(date): implement -r flag for file modification time#1141
chaliy merged 1 commit intomainfrom
fix/issue-1113-date-r

Conversation

@chaliy
Copy link
Copy Markdown
Contributor

@chaliy chaliy commented Apr 7, 2026

Summary

  • Implement date -r <file> / --reference=<file> to display file modification time from VFS
  • Return proper error message for nonexistent files (cannot stat '...': No such file or directory)
  • Add 5 tests: mtime retrieval, file-not-found, format string, long flag, UTC mode

Test plan

  • cargo test -p bashkit --lib -- date:: — all 47 tests pass (5 new)
  • cargo fmt — no changes needed
  • cargo clippy — no new warnings

Closes #1113

date -r <file> now stats the file on VFS and uses its mtime.
Supports -r, --reference, and --reference= forms.
Returns proper error for nonexistent files.

Closes #1113
@chaliy chaliy merged commit 45e3583 into main Apr 7, 2026
27 checks passed
@chaliy chaliy deleted the fix/issue-1113-date-r branch April 7, 2026 05:48
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.

fix(date): date -r does not return file modification time

1 participant