-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
"ls" functionality when called with a directory #971
Copy link
Copy link
Closed
Labels
feature-requestNew feature or requestNew feature or request
Description
(I'm sorry if this is a duplicate, I can't imagine it's not, yet I've search a lot and can't find anything)
It would be wonderful if bat behaved like ls -lh ... when executed with a directory as an arg.
This would be particularly useful when looking for a file to display; currently I often end up replacing bat with ls -lh at the beginning of a long path.
Obviously it would be useful if the output was highlighted unlike normal ls.
The main downside I can imagine would be confusion when "conbatenating" multiple files: if I accidentally included a directory instead of a file as one of the paths, however:
- unlike
catI imaginebatis rarely used for this, especially in scripts batcould continue to use a non-zero exit code when executed with a path to show it's not the primary intended purpose, while still showing the list of files - I'm not advocating this, just a potential work around
If this is something you'd be interested in, I'd be willing to have a crack at a PR, through I a somewhat novice rust developer.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
feature-requestNew feature or requestNew feature or request