The MultiSeparatorCapable trait allows commands to accept multiple --sep flags and merge results from different separator domains into a unified view.
Recur uses different separators in different domains:
- Docs/Tests: Use
.(dots) -main.command.files.readme.md - Source code: Use
_(underscores) -main_command_files_impl.rs
Currently, you must query each domain separately:
recur tree "main" -d docs/ # Only sees docs
recur tree "main" -d src/ --sep _ # Only sees sourceThis means you can't see the complete picture - where docs, tests, and implementation all exist together.
Multiple separators merge the logical hierarchy:
recur tree "main" --sep "." --sep "_"Output shows ALL files under their logical nodes:
main.command.files/
readme.md # from docs (. separator)
test.jl # from tests (. separator)
impl.rs # from src (_ separator)
stdin.rs # from src (_ separator)
See all artifacts for a command:
recur tree "main.command.files" --sep "." --sep "_"Shows:
- Documentation (
.mdfiles) - Tests (
.jlfiles) - Implementation (
.rsfiles)
List all files for a pattern:
recur files "main.command.**" --sep "." --sep "_"Gets every file across docs, tests, and source.
Use --sep-replace-default to align paths visually:
recur files "main.command.**" --sep "." --sep "_" --sep-replace-default "."Output (normalized to dots):
main.command.files.readme.md
main.command.files.test.jl
main.command.files.impl.rs # actually main_command_files_impl.rs
main.command.files.stdin.rs # actually main_command_files_stdin.rs
Use --show-sep to see which separator (domain) each file uses:
recur tree "main.command.files" --sep "." --sep "_" --show-sepOutput:
main.command.files/
readme.md [.]
test.jl [.]
impl.rs [_]
stdin.rs [_]
This shows completeness - which domains have files for this feature.
Primary use case - shows merged hierarchy:
recur tree "main" --sep "." --sep "_"
recur tree "main" --sep "." --sep "_" --sep-replace-default "."
recur tree "main" --sep "." --sep "_" --show-sepLists all matching paths from all separator domains:
recur files "main.command.**" --sep "." --sep "_"
recur files "main.command.**" --sep "." --sep "_" --sep-replace-default "." --show-sepSpecify multiple separators to query. Each separator scans the hierarchy independently, then results are merged.
--sep "." --sep "_" # Query both dot and underscore hierarchiesNormalize all output paths to use this separator, regardless of actual file separator.
--sep-replace-default "." # Show all paths with dotsUseful for:
- Visual alignment
- Piping to tools expecting consistent format
- Understanding logical hierarchy without separator noise
Append the actual separator used after each file/path.
--show-sep # Show [.] or [_] after each fileUseful for:
- Seeing which domain (docs vs src) a file belongs to
- Understanding completeness across domains
- Debugging multi-separator queries
Commands implement the trait:
pub trait MultiSeparatorCapable {
fn execute_with_separators(
&self,
separators: Vec<char>,
replace_default: Option<char>,
show_sep: bool,
) -> anyhow::Result<()>;
}The trait handles:
- Running queries with each separator
- Merging results by logical hierarchy
- Normalizing separators if requested
- Annotating with separator markers if requested
Results are merged by logical path:
- Query with separator
.findsmain.command.files.readme.md - Query with separator
_findsmain_command_files_impl.rs - Both map to logical path
main → command → files - Merged output shows both under
main.command.files/
Both domains can have files with the same logical name:
docs/main.command.files.readme.md
src/main_command_files_readme.rs
Both appear in merged output - no conflict.
Without --sep-replace-default, paths display with their actual separator:
main.command.files.readme.md
main_command_files_impl.rs
With --sep-replace-default ".":
main.command.files.readme.md
main.command.files.impl.rs # normalized!
The logical hierarchy is the source of truth.
Different domains (docs, tests, source) use different physical separators due to technical constraints (Rust identifiers can't have dots). But they represent the same logical structure.
Multi-separator support unifies this - you see the complete feature across all domains.
Find what exists for the files command:
recur tree "main.command.files" --sep "." --sep "_" --show-sepOutput:
main.command.files/
readme.md [.] # ✅ Documented
test.jl [.] # ✅ Tested
impl.rs [_] # ✅ Implemented
stdin.rs [_] # ✅ Has stdin support
Gap analysis - see which commands lack implementation:
recur files "main.command.**" --sep "." --sep "_" --show-sep | grep -v "\[_\]"Shows files that only exist in docs/tests but not in src.
- main.trait.stdin - StdinCapable trait pattern
- main.trait.content_search - ContentSearchCapable trait pattern
- main.separator.history - Separator design decisions