Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
cli: Add `--title` and `--description` edit option
Yorgos Saslis committed 1 year ago
commit a1cd0e2fdc9416a6841e15bb1075db0e7a99424c
parent f0390e00d9e1ef6de22d057935fd16757d9229d4
1 file changed +10 -6
modified radicle-cli/src/commands/issue.rs
@@ -37,7 +37,7 @@ Usage

    rad issue [<option>...]
    rad issue delete <issue-id> [<option>...]
-
    rad issue edit <issue-id> [<option>...]
+
    rad issue edit <issue-id> [--title <title>] [--description <text>] [<option>...]
    rad issue list [--assigned <did>] [--all | --closed | --open | --solved] [<option>...]
    rad issue open [--title <title>] [--description <text>] [--label <label>] [<option>...]
    rad issue react <issue-id> [--emoji <char>] [--to <comment>] [<option>...]
@@ -229,10 +229,17 @@ impl Args for Options {
                    });
                }

-
                // Open options.
-
                Long("title") if op == Some(OperationName::Open) => {
+
                // Open/Edit options.
+
                Long("title")
+
                    if op == Some(OperationName::Open) || op == Some(OperationName::Edit) =>
+
                {
                    title = Some(parser.value()?.to_string_lossy().into());
                }
+
                Long("description")
+
                    if op == Some(OperationName::Open) || op == Some(OperationName::Edit) =>
+
                {
+
                    description = Some(parser.value()?.to_string_lossy().into());
+
                }
                Short('l') | Long("label") if matches!(op, Some(OperationName::Open)) => {
                    let val = parser.value()?;
                    let name = term::args::string(&val);
@@ -246,9 +253,6 @@ impl Args for Options {

                    assignees.push(did);
                }
-
                Long("description") if op == Some(OperationName::Open) => {
-
                    description = Some(parser.value()?.to_string_lossy().into());
-
                }

                // State options.
                Long("closed") if op == Some(OperationName::State) => {