From 94c6cd43413f266f0db898cfb3fc7a9833509ef8 Mon Sep 17 00:00:00 2001 From: kaotisk Date: Tue, 27 Feb 2024 02:14:19 +0200 Subject: Refactored function names --- bin/ak-config | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'bin/ak-config') diff --git a/bin/ak-config b/bin/ak-config index 47733cb..a5afec5 100755 --- a/bin/ak-config +++ b/bin/ak-config @@ -1,11 +1,11 @@ #!/bin/bash PROGRAM="$(basename $0)" -title(){ +_ak_config_title(){ echo "Arching Kaos Configuration Tool" echo "===============================" } -usage(){ - title +_ak_config_usage(){ + _ak_config_title echo "" echo "Usage: $PROGRAM [ show | publish | get-published ]" echo "" @@ -16,7 +16,7 @@ usage(){ exit 0 } -show(){ +_ak_config_show(){ echo ' { "profile":'$(ak-profile index | jq -cM)', @@ -27,8 +27,8 @@ show(){ }'; } -publish(){ - show | jq -c -M > tmpfile +_ak_config_publish(){ + _ak_config_show | jq -c -M > tmpfile ipfs key list | grep ak-config 2> /dev/null 1>&2 if [ "$?" -ne 0 ] then @@ -44,7 +44,7 @@ publish(){ rm tmpfile } -published(){ +_ak_config_published(){ ak-ipfs-cat $(ak-akid-get-ipfs-hash) | jq -c } @@ -56,11 +56,11 @@ rm $KEY if [ ! -z $1 ]; then case $1 in - show) show;exit;; - publish) publish;exit;; - get-published) published;exit;; - *) usage;exit;; + show) _ak_config_show;exit;; + publish) _ak_config_publish;exit;; + get-published) _ak_config_published;exit;; + *) _ak_config_usage;exit;; esac else - usage + _ak_config_usage fi -- cgit v1.2.3