From 02e05f7a05d1bff900faaceac8f972c332c33f8b Mon Sep 17 00:00:00 2001 From: adlee-was-taken Date: Wed, 6 May 2026 17:42:38 -0400 Subject: [PATCH] refactor(cli): add commands/, prompt.rs, parse.rs scaffold (no-op) --- crates/relicario-cli/src/commands/mod.rs | 7 +++++++ crates/relicario-cli/src/main.rs | 3 +++ crates/relicario-cli/src/parse.rs | 5 +++++ crates/relicario-cli/src/prompt.rs | 7 +++++++ 4 files changed, 22 insertions(+) create mode 100644 crates/relicario-cli/src/commands/mod.rs create mode 100644 crates/relicario-cli/src/parse.rs create mode 100644 crates/relicario-cli/src/prompt.rs diff --git a/crates/relicario-cli/src/commands/mod.rs b/crates/relicario-cli/src/commands/mod.rs new file mode 100644 index 0000000..589e520 --- /dev/null +++ b/crates/relicario-cli/src/commands/mod.rs @@ -0,0 +1,7 @@ +//! Per-command modules — one file per top-level subcommand. +//! +//! `main.rs` holds the clap surface (argument enums) and the dispatch +//! `match`; the actual command bodies live here. Helpers shared between +//! command modules (e.g. `commit_paths`, `resolve_query`) are defined in +//! this file as `pub(crate)` so siblings can pull them in via +//! `use crate::commands::*`. diff --git a/crates/relicario-cli/src/main.rs b/crates/relicario-cli/src/main.rs index 1ebf32f..141e959 100644 --- a/crates/relicario-cli/src/main.rs +++ b/crates/relicario-cli/src/main.rs @@ -2,9 +2,12 @@ //! //! See module docs for the unlock flow and vault layout. +mod commands; mod device; mod gitea; mod helpers; +mod parse; +mod prompt; mod session; use std::path::PathBuf; diff --git a/crates/relicario-cli/src/parse.rs b/crates/relicario-cli/src/parse.rs new file mode 100644 index 0000000..fb9dfce --- /dev/null +++ b/crates/relicario-cli/src/parse.rs @@ -0,0 +1,5 @@ +//! Small parsers used by the CLI (`MM/YY[YY]`, lenient base32, MIME guess). +//! +//! Phase 7 of the CLI restructure migrates these to `relicario-core` and +//! turns this file into a thin re-export shim. They live here for now so +//! the Phase 1 relocation stays mechanical. diff --git a/crates/relicario-cli/src/prompt.rs b/crates/relicario-cli/src/prompt.rs new file mode 100644 index 0000000..3bd4d91 --- /dev/null +++ b/crates/relicario-cli/src/prompt.rs @@ -0,0 +1,7 @@ +//! Interactive prompt helpers for the CLI. +//! +//! The `prompt`/`prompt_optional`/`prompt_secret` family reads from stdin / +//! the TTY; the `prompt_keep`/`prompt_keep_opt`/`prompt_yesno` variants are +//! used by the edit handlers to keep current values when the user hits enter +//! at a blank prompt. `prompt_secret` honours `RELICARIO_TEST_ITEM_SECRET` +//! so integration tests (which don't have a TTY) can inject secrets.