aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2022-05-01 12:54:46 -0400
committerBruce Hill <bruce@bruce-hill.com>2022-05-01 12:54:46 -0400
commit7dbe5cac44ca7f336c92b2f2bf4a14462bc333ec (patch)
treee00f9fb066d5a1be9a6a469d841e7802634ae5b6
parentf66a76ad6ebb9f8e0f1f7df3826db37c772c223b (diff)
Added -e/--edit for editing
-rwxr-xr-xnowopen4
1 files changed, 4 insertions, 0 deletions
diff --git a/nowopen b/nowopen
index 4600667..be7a29e 100755
--- a/nowopen
+++ b/nowopen
@@ -20,6 +20,10 @@ local XDG_DATA_HOME = os.getenv("XDG_DATA_HOME") or "~/.local/share"
if arg[1] == '-w' or arg[1] == '--where' then
print(XDG_DATA_HOME..'/nowopen/businesshours')
os.exit(0)
+elseif arg[1] == '-e' or arg[1] == '--edit' then
+ local editor = os.getenv("EDITOR") or "vim"
+ os.execute(editor.." "..XDG_DATA_HOME..'/nowopen/businesshours')
+ os.exit(0)
end
local f = io.open(XDG_DATA_HOME..'/nowopen/businesshours') or io.open('~/.businesshours')
if not f then