summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--README.gmi5
-rwxr-xr-xgnbug7
2 files changed, 12 insertions, 0 deletions
diff --git a/README.gmi b/README.gmi
index 11d3b83..b08ae8b 100644
--- a/README.gmi
+++ b/README.gmi
@@ -38,6 +38,11 @@ Only list issues assigned to pjotrp.
 ./gnbug list --assigned=pjotrp
 ```
 
+Edit an issue, say issue 9. This opens the relevant gemtext file in your favourite editor as defined by the EDITOR environment variable.
+```
+./gnbug edit 9
+```
+
 List issues that were created or updated in the last 3 days, in the last week or month respectively. The --since argument is passed directly to `git log`. Therefore, gnbug understands any --since argument that `git log` understands.
 ```
 ./gnbug news --since='3 days'
diff --git a/gnbug b/gnbug
index 9ec0e62..a617995 100755
--- a/gnbug
+++ b/gnbug
@@ -230,5 +230,12 @@ terminal."
                                                                                     ")")))))))))
                                rcount
                                (issues)))))
+    ((_ "edit" issue-number)
+     (unless (getenv "EDITOR")
+       (error "Please set the EDITOR environment variable to your favorite editor. For example,
+export EDITOR=emacsclient"))
+     (invoke (getenv "EDITOR")
+             (issue-file (list-ref (issues)
+                                   (1- (string->number issue-number))))))))
 
 (apply main (command-line))