OSDN Git Service

[update] : Added edit command
authorhayao <hayao@fascode.net>
Sun, 8 Aug 2021 02:26:07 +0000 (11:26 +0900)
committerhayao <hayao@fascode.net>
Sun, 8 Aug 2021 02:26:07 +0000 (11:26 +0900)
fascode-gtk-bookmarks/fascode-gtk-bookmarks

index e56d011..f1014c7 100755 (executable)
@@ -41,6 +41,7 @@ _help() {
     echo "    init                  Initializes the sidebar"
     echo "    backup                Backup sidebar"
     echo "    restore               Restore bookmark from backup"
+    echo "    edit                  Edit bookmark file (with EDITOR variable)"
     echo "    help                  This help message and exit"
 }
 
@@ -271,6 +272,11 @@ restore(){
 
 }
 
+edit(){
+    local _editor="${EDITOR-"vi"}"
+    eval "${_editor}" "${bookmark_file}"
+}
+
 # Argument analysis and processing
 ARGUMENT=("${@}")
 OPTS=("f" "h" "s")
@@ -383,6 +389,10 @@ case "${mode}" in
         shift 1
         restore
         ;;
+    edit)
+        shift 1
+        edit
+        ;;
     help)
         shift 1
         _help