aboutsummaryrefslogtreecommitdiff
path: root/bin/ak-categories
diff options
context:
space:
mode:
authorkaotisk <kaotisk@arching-kaos.org>2024-03-31 12:00:59 +0300
committerkaotisk <kaotisk@arching-kaos.org>2024-03-31 12:00:59 +0300
commite4f18be94261b39544ef3bc50321f6aedeb45bd6 (patch)
tree2c79daf0bdc91beb91846f00bb3d3f51236967cf /bin/ak-categories
parent23a61661f03c03a357ad8aa47ba3595fabe24de1 (diff)
downloadarching-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-categories')
-rwxr-xr-xbin/ak-categories38
1 files changed, 19 insertions, 19 deletions
diff --git a/bin/ak-categories b/bin/ak-categories
index 6f2da6c..c0e1e77 100755
--- a/bin/ak-categories
+++ b/bin/ak-categories
@@ -1,12 +1,25 @@
#!/bin/bash
+##
+## -h, --help Prints this help message"
+##
+## index Prints an indexed table of your news files"
+##
+## import <file> #TODO"
+##
+## add <file> Creates a data file from the news file you point to"
+##
+## create Vim is going to pop up, you will write and save your"
+## newsletter and it's going to be saved"
+##
AK_CATEGORIES="$AK_WORKDIR/categories"
PROGRAM="$(basename $0)"
descriptionString="A module for adding and refering zblocks to categories"
-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
if [ ! -d $AK_CATEGORIES ]; then
mkdir $AK_CATEGORIES
@@ -41,9 +54,6 @@ _ak_modules_categories_index(){
let i+=1
done
}
-_ak_modules_categories_title(){
- description
-}
_ak_modules_categories_import(){
echo "#TODO"
@@ -92,7 +102,7 @@ EOF
logit "ERROR" "File $FILE doesn't exist";
exit 2
fi
- ak-zblock-pack "news/add" $(pwd)/data
+ _ak_zblock_pack "news/add" $(pwd)/data
if [ $? == 0 ]
then
logit "INFO" "News added successfully"
@@ -102,25 +112,15 @@ EOF
fi
}
-_ak_modules_categories_usage(){
- _ak_modules_categories_title
- echo " -h, --help Prints this help message"
- echo " index Prints an indexed table of your news files"
- echo " import <file> #TODO"
- echo " add <file> Creates a data file from the news file you point to"
- echo " create Vim is going to pop up, you will write and save your"
- echo " newsletter and it's going to be saved"
- exit 0
-}
if [ ! -z $1 ]; then
case $1 in
- -h | --help) _ak_modules_categories_usage; exit;;
+ -h | --help) _ak_usage; exit;;
index) _ak_modules_categories_index; exit;;
import) _ak_modules_categories_import $2; exit;;
add) _ak_modules_categories_add $2; exit;;
create) _ak_modules_categories_create; exit;;
- * ) _ak_modules_categories_usage;;
+ * ) _ak_usage;;
esac
-else _ak_modules_categories_usage
+else _ak_usage
fi