You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(ls): add --metadata flag to preserve permissions, sizes, and dates - #1175
This pull request has been automatically marked as stale due to 90 days of inactivity. If this pull request is still relevant, please leave any comment (for example, "bump"), and we'll keep it open. Your contribution is very much appreciated — we're sorry we haven't been able to review it yet.
Thanks for this. Metadata in rtk ls landed on develop through #1675 on 2026-05-25, which detects the long listing automatically from -l and also from -g, -n, -o, --full-time and --format=long or verbose, and renders permissions as octal next to the size, so the explicit -m flag is no longer needed. One thing this PR had that develop does not is the modification date in the compact listing, and a small PR adding the date to the existing long mode would be welcome. Worth noting the parsing here goes back to fixed whitespace columns, which is what #1675 replaced with a date-anchored parser so that owner and group names containing spaces do not shift the size and filename fields. If you think part of this was missed, please comment or reopen.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add
--metadata(-m) flag to thelscommand that preserves file permissions, sizes, dates, and other metadata in the compact output.Changes
src/main.rs: Added--metadata(-m) flag to the Ls commandsrc/cmds/system/ls.rs:compact_lsto parse and store permissions, dates, and sizes(1.2K, Jan 15, -rw-r--r--)-lflag in args and enables metadata mode automaticallyExample
Fixes #1162