Skip to content

Commit 8bcaf98

Browse files
docs(cli): document diff-command option (#94)
1 parent 2ca6744 commit 8bcaf98

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

docs/architecture.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ Each file under `src/strategies/` provides a `process` function that sorts lines
6262

6363
`main.rs` implements the command-line interface using `clap`. It parses arguments, selects the formatting mode (check, diff or fix) and passes a single file to `handle_file`. Directory traversal is intentionally left to external scripts so that the binary stays simple and composable. There is deliberately no `-r` or `--recursive` option; use tools like `git ls-files` if you need to process multiple files. The helper `handle_file` runs the crate API on each file and applies the chosen mode.
6464

65+
When `--mode diff` is used, the CLI can delegate diff generation to an external
66+
program by passing `--diff-command <command>`. The option is parsed and executed
67+
in `src/main.rs` where `Command` spawns the specified tool to show changes.
68+
6569
`keepsorted` focuses on sorting and does not try to walk directories itself. Implementing a fully featured crawler would require handling ignore files, generated sources and other project-specific rules. Existing tools already solve these problems, so the CLI expects callers to provide an explicit list of files. This design keeps the binary small while letting users combine it with powerful shell filters.
6670

6771
### Crate API (`src/lib.rs`)

0 commit comments

Comments
 (0)