feat: 新增 disk usage 内置命令(跨平台 du 等价)

- 注册表新增 Variant.Builtin 内置动作,与 Argv 互斥并参与平台匹配
- disk.usage 支持位置参数与 --path/--path=,输出按大小降序并带合计
- Unix 用设备号实现 -x 不跨文件系统,Windows 降级为不跟随 reparse point
- list/help/explain 支持展示内置动作,补充单元与 CLI 测试、README
This commit is contained in:
2026-10-31 13:11:24 +08:00
parent 7d9852958f
commit 84f7361396
12 changed files with 672 additions and 9 deletions
+12
View File
@@ -0,0 +1,12 @@
//go:build windows
package executor
import "os"
// Windows has no stable per-file device ID in os.FileInfo. Directory walks do
// not cross volumes on their own, so -x degrades to "do not follow reparse
// points", which filepath.WalkDir already guarantees.
func deviceOf(os.FileInfo) (uint64, bool) { return 0, false }
func deviceOfPath(string) (uint64, bool) { return 0, false }