# joeleehen/rsls architecture

> Architecture diagram of the GitHub repository joeleehen/rsls, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/joeleehen/rsls
- Repository: https://github.com/joeleehen/rsls

## Overview

rsls is a Rust command-line directory lister. The user supplies a directory and options; the program parses those options, reads directory entries, optionally gathers long-format metadata, and prints a listing adapted to terminal or piped output. The sampled main source shows directory scanning, metadata formatting, icon/color handling, and terminal layout in one file. The README documents hidden-file and long-format options; unsampled control flow is not expanded into speculative stages.

Main entry points: [`src/main.rs`](https://github.com/joeleehen/rsls/blob/master/src/main.rs) (Listing and metadata), [`src/args.rs`](https://github.com/joeleehen/rsls/blob/master/src/args.rs) (Option parser), [`src/colors.rs`](https://github.com/joeleehen/rsls/blob/master/src/colors.rs) (ANSI colors)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI"]
  node_args["Option parser<br/>[args.rs]"]
end

subgraph group_listing["Listing runtime"]
  node_main["Listing and metadata<br/>[main.rs]"]
  node_filesystem["Local filesystem"]
end

subgraph group_presentation["Presentation"]
  node_colors["ANSI colors<br/>[colors.rs]"]
end

node_user(("CLI user"))
node_terminal["Terminal or pipe"]

node_user -->|"invokes"| node_main
node_main -->|"parses options"| node_args
node_main -->|"reads entries and metadata"| node_filesystem
node_main -->|"prints listing"| node_terminal
node_main -->|"uses ANSI colors"| node_colors

click node_args "https://github.com/joeleehen/rsls/blob/master/src/args.rs"
click node_main "https://github.com/joeleehen/rsls/blob/master/src/main.rs"
click node_colors "https://github.com/joeleehen/rsls/blob/master/src/colors.rs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_args,node_user toneBlue
class node_main,node_filesystem toneAmber
class node_colors toneMint
class node_terminal toneIndigo
```

## Components

### CLI

- [Option parser](https://github.com/joeleehen/rsls/blob/master/src/args.rs): `src/args.rs`

### Listing runtime

- [Listing and metadata](https://github.com/joeleehen/rsls/blob/master/src/main.rs): `src/main.rs`
- **Local filesystem**

### Presentation

- [ANSI colors](https://github.com/joeleehen/rsls/blob/master/src/colors.rs): `src/colors.rs`

### Other components

- **CLI user**
- **Terminal or pipe**

## Connections

- CLI user → Listing and metadata: invokes (evidence: `README.md`)
- Listing and metadata → Option parser: parses options (evidence: `src/main.rs`)
- Listing and metadata → Local filesystem: reads entries and metadata (evidence: `src/main.rs`)
- Listing and metadata → Terminal or pipe: prints listing (evidence: `src/main.rs`)
- Listing and metadata → ANSI colors: uses ANSI colors (evidence: `src/main.rs`)
