cli: print success to console on `rad issue state`

Indicate that the `rad issue state` operation was successful to the
user by printing a message to the console.

Solves:

    rad issue show 71020de8478b15b3f7a619f2f93d3cfb8771cde2
This commit is contained in:
Fintan Halpenny 2024-10-24 09:19:24 +01:00 committed by cloudhead
parent ffbdabe432
commit f0390e00d9
No known key found for this signature in database
2 changed files with 20 additions and 0 deletions

View File

@ -123,3 +123,12 @@ To publish our new state to the network, we simply push:
```
$ git push
```
Finally, we will close the issue that was opened for this
patch, marking it as solved:
```
$ rad issue state 9037b7a --solved
✓ Issue 9037b7a is now solved
✓ Synced with 1 node(s)
```

View File

@ -567,6 +567,17 @@ pub fn run(options: Options, ctx: impl term::Context) -> anyhow::Result<()> {
let id = id.resolve(&repo.backend)?;
let mut issue = issues.get_mut(&id)?;
issue.lifecycle(state, &signer)?;
if !options.quiet {
let success =
|status| term::success!("Issue {} is now {status}", term::format::cob(&id));
match state {
State::Closed { reason } => match reason {
CloseReason::Other => success("closed"),
CloseReason::Solved => success("solved"),
},
State::Open => success("open"),
};
}
}
Operation::React {
id,