From 116ae533b44417ff25e7fed891f67412d66b88d5 Mon Sep 17 00:00:00 2001 From: Emil Miler Date: Thu, 30 May 2024 22:17:46 +0200 Subject: [PATCH] Even moar improvements --- manage | 18 +++++++++++++++--- readme.md | 13 ------------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/manage b/manage index 961a17d..56b1da0 100755 --- a/manage +++ b/manage @@ -7,14 +7,16 @@ usage() { Usage: $0 [options] Commands: - help Show this help message and exit - new [name] Create a new song [with the specified name] - edit Edit song with $EDITOR (taken from the EDITOR env var) + help Show this help message and exit + new [name] Create a new song [with the specified name] + edit Edit song with $EDITOR (taken from the EDITOR env var) + iedit Interactive edit with PDF preview Examples: $0 help $0 new [song-name] $0 edit + $0 iedit EOF exit 1 @@ -53,6 +55,16 @@ case "$1" in usage fi ;; + iedit) + if [ "$#" -eq 2 ]; then + touch "content/$2/$2.pdf" + zathura "content/$2/$2.pdf" & # I don't give a fuck; use Zathura or send a patch + $EDITOR "content/$2/$2.cho" + else + echo -e "Missing song name\n" + usage + fi + ;; help) usage ;; diff --git a/readme.md b/readme.md index 50bc451..6d21aab 100644 --- a/readme.md +++ b/readme.md @@ -39,16 +39,3 @@ This is done by default during the deploy pipeline. The `manage` shell script lets you do basic song management and saves you some manual labour. Simply run the script itself or invoke `help` to get a list of all available commands. - -``` -./manage help -Usage: ./manage [options] - -Commands: - help Show this help message and exit - new Create a new song with the specified name - -Examples: - ./manage help - ./manage new [song-name] -```