diff options
| author | Jason Rayne <yo@arcayne.dev> | 2025-07-03 20:11:45 -0700 |
|---|---|---|
| committer | Jason Rayne <yo@arcayne.dev> | 2025-07-03 20:11:45 -0700 |
| commit | 75c703071a6ab176f2d7982a17cde1e593e14737 (patch) | |
| tree | 2ee675f81ef272b16d57178dbb6647522b772c93 /src/cli/action.zig | |
| parent | e25aa9f424097938362a9d6b02fa32c1714ab97f (diff) | |
feat(ssh): rewrite SSH cache system in native Zig
- Eliminates standalone bash dependency
- Consolidates `+list-ssh-cache` and `+clear-ssh-cache` actions into
single `+ssh-cache` action with args
- Structured cache format with timestamps and expiration support
- Memory-safe entry handling with proper file locking
- Comprehensive hostname validation (IPv4/IPv6/domains)
- Atomic updates via temp file + rename
- Updated shell integrations for improved cross-platform support and
reliability
- Cache operations are now unit-testable
Diffstat (limited to 'src/cli/action.zig')
| -rw-r--r-- | src/cli/action.zig | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/src/cli/action.zig b/src/cli/action.zig index 9d1fad027..728f36efe 100644 --- a/src/cli/action.zig +++ b/src/cli/action.zig @@ -9,8 +9,7 @@ const list_keybinds = @import("list_keybinds.zig"); const list_themes = @import("list_themes.zig"); const list_colors = @import("list_colors.zig"); const list_actions = @import("list_actions.zig"); -const list_ssh_cache = @import("list_ssh_cache.zig"); -const clear_ssh_cache = @import("clear_ssh_cache.zig"); +const ssh_cache = @import("ssh_cache.zig"); const edit_config = @import("edit_config.zig"); const show_config = @import("show_config.zig"); const validate_config = @import("validate_config.zig"); @@ -43,11 +42,8 @@ pub const Action = enum { /// List keybind actions @"list-actions", - /// List hosts cached by SSH shell integration for terminfo installation - @"list-ssh-cache", - - /// Clear hosts cached by SSH shell integration for terminfo installation - @"clear-ssh-cache", + /// Manage SSH terminfo cache for automatic remote host setup + @"ssh-cache", /// Edit the config file in the configured terminal editor. @"edit-config", @@ -163,8 +159,7 @@ pub const Action = enum { .@"list-themes" => try list_themes.run(alloc), .@"list-colors" => try list_colors.run(alloc), .@"list-actions" => try list_actions.run(alloc), - .@"list-ssh-cache" => try list_ssh_cache.run(alloc), - .@"clear-ssh-cache" => try clear_ssh_cache.run(alloc), + .@"ssh-cache" => try ssh_cache.run(alloc), .@"edit-config" => try edit_config.run(alloc), .@"show-config" => try show_config.run(alloc), .@"validate-config" => try validate_config.run(alloc), @@ -202,8 +197,7 @@ pub const Action = enum { .@"list-themes" => list_themes.Options, .@"list-colors" => list_colors.Options, .@"list-actions" => list_actions.Options, - .@"list-ssh-cache" => list_ssh_cache.Options, - .@"clear-ssh-cache" => clear_ssh_cache.Options, + .@"ssh-cache" => ssh_cache.Options, .@"edit-config" => edit_config.Options, .@"show-config" => show_config.Options, .@"validate-config" => validate_config.Options, |
