From e4f18be94261b39544ef3bc50321f6aedeb45bd6 Mon Sep 17 00:00:00 2001 From: kaotisk Date: Sun, 31 Mar 2024 12:00:59 +0300 Subject: huge refactor, might breaking things --- bin/ak-articles | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) (limited to 'bin/ak-articles') diff --git a/bin/ak-articles b/bin/ak-articles index ba45309..97a8e8d 100755 --- a/bin/ak-articles +++ b/bin/ak-articles @@ -1,12 +1,21 @@ #!/bin/bash - +## +## -h, --help Prints this help message +## index Prints an indexed table of your articles files +## import TODO +## add Creates a data file from the articles file you point to +## create Vim is going to pop up, you will write and save your +## articlesletter and it's going to be saved +## +fullprogrampath="$(realpath $0)" PROGRAM=$(basename $0) descriptionString="Articles module for Arching Kaos" -source $AK_LIBDIR/_ak_logit -source $AK_LIBDIR/_ak_script_description +source $AK_LIBDIR/_ak_log +source $AK_LIBDIR/_ak_script source $AK_LIBDIR/_ak_ipfs source $AK_LIBDIR/_ak_gpg +source $AK_LIBDIR/_ak_zblock ZARTICLESDIR="$AK_WORKDIR/articles" TEMP="/tmp/aktmp" @@ -108,7 +117,7 @@ EOF echo "File $FILE doesn't exist"; exit 2 fi - ak-zblock-pack "articles/add" $(pwd)/data + _ak_zblock_pack "articles/add" $(pwd)/data if [ $? == 0 ] then echo "Articles added successfully" @@ -117,24 +126,14 @@ EOF exit 1 fi } -_ak_modules_articles_usage(){ - echo " -h, --help Prints this help message" - echo " index Prints an indexed table of your articles files" - echo " import #TODO" - echo " add Creates a data file from the articles file you point to" - echo " create Vim is going to pop up, you will write and save your" - echo " articlesletter and it's going to be saved" - exit 0 -} -_ak_modules_articles_title if [ ! -z $1 ]; then case $1 in - -h | --help) _ak_modules_articles_usage; exit;; + -h | --help) _ak_usage; exit;; index) _ak_modules_articles_index; exit;; import) _ak_modules_articles_import $2; exit;; add) _ak_modules_articles_add $2; exit;; create) _ak_modules_articles_create; exit;; - * ) _ak_modules_articles_usage;; + * ) _ak_usage;; esac -else _ak_modules_articles_usage +else _ak_usage fi -- cgit v1.2.3