Fli - 一个小巧(18KB)、易于阅读的文件列表工具。Rust no_std 和 Libc

2作者: tracyspacy大约 12 小时前
为什么? 我只能通过 SSH 访问我的树莓派 Zero。对我来说,根据颜色区分文件类型等内容很困难,我需要更具可读性和清晰度的东西,比如图片/图标或表情符号,因为我最终会遇到各种各样的文件。我决定构建 fli,并且由于 ls 几乎在任何机器上都预装了,fli 作为补充工具的第二个要求是体积小巧。 可读性:得益于使用表情符号(和)而不是文本着色,可读性极佳。 大小:由于 Rust 的标准库对二进制文件的大小贡献很大,因此该项目采用了 no_std + libc。 当前二进制文件大小:M 系列 Mac 51KB,rpi zero 18KB。 显示选项: `fli`:简短(名称和类型)未排序输出 - 直接流,无堆分配 `fli -s`:简短(名称和类型)按名称排序输出 - 使用堆分配 `fli -l`:长(名称、类型、元数据)未排序输出和固定大小对齐(大小和链接数占 20 个字符)- 直接流,无堆分配 `fli -l -s`:长(名称、类型、元数据)按名称排序输出和动态对齐 - 使用堆分配。 `fli -l -S`:长(名称、类型、元数据)按大小排序输出和动态对齐 - 使用堆分配。 GitHub 仓库:https://github.com/tracyspacy/fli
查看原文
Why?<p>I have access to my raspberry pi zero via ssh only. As for me it is hard to differentiate types of files etc based on colors, I needed something more readable and clear like picture&#x2F;icon or emoji as I ended up with etc. And I decided to build fli and since ls is obviosly preinstalled on almost any machine, the second requirement for fli as a complimentary tool, is to be tiny.<p>Readability: Nice readability thanks to use of emojis ( and ) instead of text coloring.<p>Size: Since rust std contributes heavily to binary size, this project is no_std + libc<p>Current binary size: M-series Mac 51KB , rpi zero 18KB.<p>Display options:<p>`fli` : short (name and type) not sorted output - direct stream, no heap allocation<p>`fli -s`: short (name and type) sorted by name output - uses heap allocation<p>`fli -l`: long (name, type, metadata ) not sorted output and fixed-sized alignment (20 chars for size and n_link) - direct stream, no heap allocation<p>`fli -l -s`: long (name, type, metadata ) sorted by name output and dynamic alignment - uses heap allocation.<p>`fli -l -S`: long (name, type, metadata ) sorted by size output and dynamic alignment - uses heap allocation.<p>GitHub repo: https:&#x2F;&#x2F;github.com&#x2F;tracyspacy&#x2F;fli