informalsystems / informalsystems/quartz
Add default CLI response impl
- 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
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