Radish alpha
h
rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5
Radicle Heartwood Protocol & Stack
Radicle
Git
cli: error on no id update
Merged fintohaps opened 2 years ago

If rad id is called with no arguments, or just --title and --description, then it will fail because there were no changes made to the identity.

Check if the proposal document is the same the current document, and if so supply a hint and a better error.

2 files changed +12 -0 864ca656 18fc41c5
modified radicle-cli/examples/rad-id.md
@@ -147,3 +147,11 @@ $ rad id update --title "Add Eve" --description "Add Eve as a delegate" --delega
✗ Error: missing delegate z6MkedT…47fovFn in local storage
✗ Error: fatal: refusing to update identity document
```
+

+
If no updates are specified then the update will fail:
+

+
``` (fail)
+
$ rad id update --title "Update canonical branch" --description "Update the canonical branch to `main`"
+
✗ Hint: an update to the identity must be specified, run `rad id update -h` to see the available options
+
✗ Error: no update to the identity was specified
+
```
modified radicle-cli/src/commands/id.rs
@@ -380,6 +380,10 @@ pub fn run(options: Options, ctx: impl term::Context) -> anyhow::Result<()> {
                }
                proposal
            };
+
            if proposal == current.doc {
+
                term::hint("an update to the identity must be specified, run `rad id update -h` to see the available options");
+
                anyhow::bail!("no update specified")
+
            }
            let revision = update(title, description, proposal, &mut identity, &signer)?;

            if revision.is_accepted() && revision.parent == Some(current.id) {