Skip to content

Add CLI pipe support for filtering command output#29

Merged
rwestphal merged 1 commit intoholo-routing:mainfrom
sha90w:feature/cli-pipes
Mar 15, 2026
Merged

Add CLI pipe support for filtering command output#29
rwestphal merged 1 commit intoholo-routing:mainfrom
sha90w:feature/cli-pipes

Conversation

@sha90w
Copy link
Copy Markdown
Contributor

@sha90w sha90w commented Mar 10, 2026

Add pipe infrastructure allowing users to filter command output through builtin and external pipe commands (e.g., show route | include 192.168 | count).

Key changes:

  • New pipe module with PipeRegistry, PipeChain, and builtin filters (include, exclude, count, no-more) plus external command support (grep)
  • Refactored all command output to flow through session.writer() instead of direct println!/page_output, enabling pipe chain interception
  • Pipe-aware tab completion with argument hints
  • Typed error handling: CallbackError preserves io::ErrorKind::BrokenPipe through the callback chain; PipeError uses typed variants (Io, Spawn, ThreadPanicked, Filter) instead of String
  • XML command tree supports pipe="true" attribute for marking pipeable commands, with ancestor-walk inheritance via is_pipeable()
  • Quote-aware pipe splitting to support patterns with spaces

Add pipe infrastructure allowing users to filter command output through
builtin and external pipe commands (e.g., `show route | include 192.168 | count`).

Key changes:
- New pipe module with PipeRegistry, PipeChain, and builtin filters
  (include, exclude, count, no-more) plus external command support (grep)
- Refactored all command output to flow through session.writer() instead
  of direct println!/page_output, enabling pipe chain interception
- Pipe-aware tab completion with argument hints
- Typed error handling: CallbackError preserves io::ErrorKind::BrokenPipe
  through the callback chain; PipeError uses typed variants (Io, Spawn,
  ThreadPanicked, Filter) instead of String
- XML command tree supports `pipe="true"` attribute for marking pipeable
  commands, with ancestor-walk inheritance via is_pipeable()
- Quote-aware pipe splitting to support patterns with spaces
@sha90w sha90w force-pushed the feature/cli-pipes branch from f852a12 to 78d33ee Compare March 10, 2026 23:01
Copy link
Copy Markdown
Member

@rwestphal rwestphal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fantastic work! Merging...

@rwestphal rwestphal merged commit 36fdc13 into holo-routing:main Mar 15, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants