diff options
author | kaotisk <kaotisk@arching-kaos.org> | 2024-03-31 12:00:59 +0300 |
---|---|---|
committer | kaotisk <kaotisk@arching-kaos.org> | 2024-03-31 12:00:59 +0300 |
commit | e4f18be94261b39544ef3bc50321f6aedeb45bd6 (patch) | |
tree | 2c79daf0bdc91beb91846f00bb3d3f51236967cf /bin/ak-comments | |
parent | 23a61661f03c03a357ad8aa47ba3595fabe24de1 (diff) | |
download | arching-kaos-tools-e4f18be94261b39544ef3bc50321f6aedeb45bd6.tar.gz arching-kaos-tools-e4f18be94261b39544ef3bc50321f6aedeb45bd6.tar.bz2 arching-kaos-tools-e4f18be94261b39544ef3bc50321f6aedeb45bd6.zip |
huge refactor, might breaking things
Diffstat (limited to 'bin/ak-comments')
-rwxr-xr-x | bin/ak-comments | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/bin/ak-comments b/bin/ak-comments index 220b1a7..6193e2f 100755 --- a/bin/ak-comments +++ b/bin/ak-comments @@ -1,11 +1,23 @@ #!/bin/bash +## +## -h, --help Prints this help message" +## +## index Prints an indexed table of your comments files" +## +## add <file> <refer_to> Creates a data file from the comments file you point to" +## +## create <refer_to> Vim is going to pop up, you will write and save your" +## commentsletter and it's going to be saved" +## +fullprogrampath="$(realpath $0)" PROGRAM="$(basename $0)" descriptionString="Comments 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 ZCOMMENTSDIR="$AK_WORKDIR/comments" TEMP="/tmp/aktmp" @@ -54,9 +66,7 @@ _ak_modules_comments_index(){ let i+=1 done } -_ak_modules_comments_title(){ - echo comments -} + _ak_modules_comments_add(){ TEMP="$(ak-tempassin)" cd $TEMP @@ -73,7 +83,7 @@ _ak_modules_comments_add(){ echo "File $FILE doesn't exist"; exit 2 fi - REFERENCE="$(ak-zblock-pack "comments/add" $(pwd)/data)" + REFERENCE="$(_ak_zblock_pack "comments/add" $(pwd)/data)" if [ $? == 0 ] then echo "Comment added successfully" @@ -82,24 +92,14 @@ _ak_modules_comments_add(){ exit 1 fi } -_ak_modules_comments_usage(){ - _ak_modules_comments_title - echo "" - echo "-h, --help Prints this help message" - echo "index Prints an indexed table of your comments files" - echo "add <file> <refer_to> Creates a data file from the comments file you point to" - echo "create <refer_to> Vim is going to pop up, you will write and save your" - echo " commentsletter and it's going to be saved" - exit 0 -} if [ ! -z $1 ]; then case $1 in - -h | --help) _ak_modules_comments_usage; exit;; + -h | --help) _ak_usage; exit;; index) _ak_modules_comments_index; exit;; add) _ak_modules_comments_add $2 $3; exit;; create) _ak_modules_comments_create $2; exit;; - * ) _ak_modules_comments_usage;; + * ) _ak_usage;; esac -else _ak_modules_comments_usage +else _ak_usage fi |