From 954f18e0fbf1a4aca76897480a3424f3db0e829b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stig-=C3=98rjan=20Smelror?= Date: Sun, 4 Feb 2024 14:16:05 +0100 Subject: [PATCH] qsgen2: Move options to after reading config file --- qsgen2 | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/qsgen2 b/qsgen2 index e430857..eab8737 100755 --- a/qsgen2 +++ b/qsgen2 @@ -88,29 +88,6 @@ _list_sites() { } -case "$1" in - add) - if [[ $# -eq 3 ]]; then - _add_site "$2" "$3" - else - echo "Usage: qsgen2 add \"Site Name\" \"/path/to/project\"" - fi - exit - ;; - list) - _list_sites - exit - ;; - force) - : >| "$blog_cache_file" # Truncate the blog cache before doing update - : >| "$pages_cache_file" # Truncate the page cache before doing update - ;; - *) - echo "Usage: qsgen2 [command]" - exit - ;; -esac - function _version() { echo "${yellow}- Created by kekePower - 2018-$(date +%Y)${end}" echo "${yellow}- https://github.com/kekePower/qsgen2/${end}" @@ -152,6 +129,29 @@ if (${debug}); then done fi +case "$1" in + add) + if [[ $# -eq 3 ]]; then + _add_site "$2" "$3" + else + echo "Usage: qsgen2 add \"Site Name\" \"/path/to/project\"" + fi + exit + ;; + list) + _list_sites + exit + ;; + force) + : >| "$blog_cache_file" # Truncate the blog cache before doing update + : >| "$pages_cache_file" # Truncate the page cache before doing update + ;; + *) + echo "Usage: qsgen2 [command]" + exit + ;; +esac + function _msg() { # Use this function to write out messages based on their type # Types are: std=green - info=yellow - debug=red other=bold_yellow