2026-02-23 11:15:39 +00:00
|
|
|
use super::{resolve_env_id_pretty, EXIT_SUCCESS};
|
feat: karapace-cli — 23 commands, thin dispatcher, progress indicators
- 23 commands, each in its own module under commands/
- Thin main.rs dispatcher with clap subcommand routing
- Progress spinners (indicatif) and colored state output (console)
- Environment resolution by env_id, short_id, name, or prefix
- Structured JSON output (--json) on all query commands
- --verbose/-v for debug, --trace for trace-level logging
- KARAPACE_LOG env var for fine-grained log control
- Exit codes: 0 success, 1 failure, 2 manifest error, 3 store error
- Prerequisite check before runtime operations
- Shell completions (bash/zsh/fish/elvish/powershell) and man page generation
2026-02-22 17:37:54 +00:00
|
|
|
use karapace_core::{Engine, StoreLock};
|
|
|
|
|
use karapace_store::StoreLayout;
|
|
|
|
|
use std::path::Path;
|
|
|
|
|
|
|
|
|
|
pub fn run(engine: &Engine, store_path: &Path, env_id: &str) -> Result<u8, String> {
|
|
|
|
|
let layout = StoreLayout::new(store_path);
|
|
|
|
|
let _lock = StoreLock::acquire(&layout.lock_file()).map_err(|e| format!("store lock: {e}"))?;
|
|
|
|
|
|
2026-02-23 11:15:39 +00:00
|
|
|
let resolved = resolve_env_id_pretty(engine, env_id)?;
|
feat: karapace-cli — 23 commands, thin dispatcher, progress indicators
- 23 commands, each in its own module under commands/
- Thin main.rs dispatcher with clap subcommand routing
- Progress spinners (indicatif) and colored state output (console)
- Environment resolution by env_id, short_id, name, or prefix
- Structured JSON output (--json) on all query commands
- --verbose/-v for debug, --trace for trace-level logging
- KARAPACE_LOG env var for fine-grained log control
- Exit codes: 0 success, 1 failure, 2 manifest error, 3 store error
- Prerequisite check before runtime operations
- Shell completions (bash/zsh/fish/elvish/powershell) and man page generation
2026-02-22 17:37:54 +00:00
|
|
|
engine.freeze(&resolved).map_err(|e| e.to_string())?;
|
|
|
|
|
println!("frozen environment {env_id}");
|
|
|
|
|
Ok(EXIT_SUCCESS)
|
|
|
|
|
}
|