diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2022-05-01 12:54:46 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2022-05-01 12:54:46 -0400 |
| commit | 7dbe5cac44ca7f336c92b2f2bf4a14462bc333ec (patch) | |
| tree | e00f9fb066d5a1be9a6a469d841e7802634ae5b6 | |
| parent | f66a76ad6ebb9f8e0f1f7df3826db37c772c223b (diff) | |
Added -e/--edit for editing
| -rwxr-xr-x | nowopen | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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 |
