cli: add Identity::current to output

Add the resulting SHA of the new Identity when performing `rad id
commit`.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
This commit is contained in:
Fintan Halpenny 2023-02-13 15:55:36 +00:00 committed by Alexis Sellier
parent 88fc4f1782
commit e7c929898a
No known key found for this signature in database
3 changed files with 5 additions and 5 deletions

View File

@ -138,7 +138,7 @@ Quorum Reached
```
$ rad id commit 57332790a2eabc0b2fd8c7ff48c3579d5812d405 --rev z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi/1 --no-confirm
ok Committed new identity 🌱
ok Committed new identity '29ae4b72f5a315328f06fbd68dc1c396a2d5c45e' 🌱
title: Add Alice
description: Add Alice as a delegate
status: committed
@ -387,7 +387,7 @@ Quorum Reached
```
$ rad id commit c3698d4e85f9d4c0ee536b34d6122fc7c81f7e2e --rev z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi/6 --no-confirm
ok Committed new identity 🌱
ok Committed new identity '60de897bc24898f6908fd1272633c0b15aa4096f' 🌱
title: Add Bob
description: Add Bob as a delegate
status: committed

View File

@ -208,7 +208,7 @@ At this point, we can commit the proposal and update the identity:
```
$ rad id commit 06d9efa2a9aad06bfdf25a25690e1ec7db2c3c39 --rev z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi/1 --no-confirm
ok Committed new identity 🌱
ok Committed new identity 'c96e764965aaeff1c6ea3e5b97e2b9828773c8b0' 🌱
title: Add Bob
description: Add Bob as a delegate
status: committed

View File

@ -417,9 +417,9 @@ pub fn run(options: Options, ctx: impl term::Context) -> anyhow::Result<()> {
warn_out_of_date(revision, &previous);
let yes = confirm(interactive, "Are you sure you want to commit?");
if yes {
Proposal::commit(&proposal, &rid, signer.public_key(), &repo, &signer)?;
let id = Proposal::commit(&proposal, &rid, signer.public_key(), &repo, &signer)?;
proposal.commit(&signer)?;
term::success!("Committed new identity 🌱",);
term::success!("Committed new identity '{}' 🌱", id.current);
print(&proposal, &previous, None)?;
}
}