mirror of
https://github.com/0xrsydn/idx-cli.git
synced 2026-11-07 09:45:36 +00:00
fix(cli): close small JSON-contract gaps for agent consumers
- --offline now warns when it serves a cache entry past its TTL; before, arbitrarily old data was returned with no signal at all - version, cache info and cache clear honour -o json - ownership resolve map/merge honour -o json - stocks quote/compare require at least one symbol instead of printing [] - cache schema-mismatch notice goes through runtime::info so --quiet silences it, instead of a raw debug eprintln Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Q2PufCUdvVZoVW1Dy53js
This commit is contained in:
parent
793d765e5a
commit
277273bc78
6 changed files with 130 additions and 18 deletions
13
src/main.rs
13
src/main.rs
|
|
@ -64,9 +64,14 @@ fn run() -> Result<(), IdxError> {
|
|||
};
|
||||
|
||||
match &cli.command {
|
||||
Commands::Version => {
|
||||
println!("{}", env!("CARGO_PKG_VERSION"));
|
||||
}
|
||||
Commands::Version => match config.output {
|
||||
OutputFormat::Json => {
|
||||
output::json::print_json(&serde_json::json!({
|
||||
"version": env!("CARGO_PKG_VERSION")
|
||||
}))?;
|
||||
}
|
||||
OutputFormat::Table => println!("{}", env!("CARGO_PKG_VERSION")),
|
||||
},
|
||||
Commands::Completions { shell } => {
|
||||
let mut cmd = Cli::command();
|
||||
let name = cmd.get_name().to_owned();
|
||||
|
|
@ -97,7 +102,7 @@ fn run() -> Result<(), IdxError> {
|
|||
}
|
||||
}
|
||||
Commands::Cache(cache) => {
|
||||
if let Err(err) = cli::cache::handle(cache) {
|
||||
if let Err(err) = cli::cache::handle(cache, &config.output) {
|
||||
emit_error(&err, &config.output);
|
||||
return Err(err);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue