A directory tree viewer implemented in Zig that replicates the functionality of PowerShell's tree command.
src/
├── main.zig # Application entry point and coordination
├── tree_formatter.zig # Tree formatting and display logic
└── dir_utils.zig # Directory operations and entry sorting utilities
-
main.zig
- Program entry point
- Command-line argument handling
- Initialization of components
-
tree_formatter.zig
- Tree visualization logic
- Output formatting
- Directory traversal coordination
-
dir_utils.zig
- Directory listing functionality
- File/directory sorting
- Hidden file detection
# Build the project
zig build
# Run with current directory
zig build run
# Run with specific directory
zig build run -- /path/to/directory- Displays directory structure in tree format
- Handles hidden files and directories
- Sorts entries (directories first, then alphabetically)
- Provides clear error messages for inaccessible directories
- Matches PowerShell's tree command output format