informalsystems / informalsystems/quartz

Add default CLI response impl

Open
#142 0 comments 0 reactions 0 assignees View on GitHub
quartz-cli
Dominant language
Rust
Stars
63
Forks
9
PR merge metrics
No merged PRs in 30d

Description

## Summary
Seems like most of our CLI commands don't have anything specific to output, so we should provide a `Response::default()` impl that just serializes to an empty string.

## Proposal
- Impl `Default` for `Response`. e.g.
```rust
#[derive(Clone, Debug, Serialize)]
#[serde(untagged)] // <--------------------
pub enum Response {
String(String),
// ...
}

impl Default for Response {
fn default() -> Self {
Self::String("".to_string())
}
}
```
- Or make `Response` optional in the `Handler` trait, e.g.
```rust
fn handle(self) -> Result, Self::Error>;
```

Contributor guide

Open the contributing guide

Research direction

Start by locating the CLI Response enum and Handler trait referenced in the proposal, then inspect how responses are serialized. Decide between a Default implementation and an optional Handler response, and verify that commands without specific output produce an empty string.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.