diff options
| author | kaotisk <kaotisk@arching-kaos.org> | 2024-02-27 02:14:19 +0200 | 
|---|---|---|
| committer | kaotisk <kaotisk@arching-kaos.org> | 2024-02-27 02:14:19 +0200 | 
| commit | 94c6cd43413f266f0db898cfb3fc7a9833509ef8 (patch) | |
| tree | 087f6f40d2e151ceed41dd03933317f35a014dfe | |
| parent | f93ebfadb3e0d89e668784cd781ad33c62e01065 (diff) | |
| download | arching-kaos-tools-94c6cd43413f266f0db898cfb3fc7a9833509ef8.tar.gz arching-kaos-tools-94c6cd43413f266f0db898cfb3fc7a9833509ef8.tar.bz2 arching-kaos-tools-94c6cd43413f266f0db898cfb3fc7a9833509ef8.zip | |
Refactored function names
| -rwxr-xr-x | bin/ak-articles | 32 | ||||
| -rwxr-xr-x | bin/ak-categories | 32 | ||||
| -rwxr-xr-x | bin/ak-comments | 26 | ||||
| -rwxr-xr-x | bin/ak-config | 24 | ||||
| -rwxr-xr-x | bin/ak-files | 12 | ||||
| -rwxr-xr-x | bin/ak-folders | 20 | ||||
| -rwxr-xr-x | bin/ak-mixtapes | 12 | ||||
| -rwxr-xr-x | bin/ak-news | 38 | ||||
| -rwxr-xr-x | bin/ak-profile | 40 | ||||
| -rwxr-xr-x | bin/ak-reference | 32 | ||||
| -rwxr-xr-x | bin/ak-todos | 32 | ||||
| -rwxr-xr-x | bin/ak-transactions | 8 | 
12 files changed, 154 insertions, 154 deletions
| diff --git a/bin/ak-articles b/bin/ak-articles index 2e94205..94e2675 100755 --- a/bin/ak-articles +++ b/bin/ak-articles @@ -15,7 +15,7 @@ else  	echo "zarticlesdir found"  fi -create(){ +_ak_modules_articles_create(){      TEMP="$(ak-tempassin)"      cd $TEMP  	pwd @@ -27,7 +27,7 @@ create(){  	IPFS_FILE=$(ak-ipfs-add $ARTICLES_FILE)  	mv $ARTICLES_FILE $ZARTICLESDIR/$TO_FILE  	sed -e 's,Qm.*,'"$IPFS_FILE"',g' $ZARTICLESDIR/README -	add $ZARTICLESDIR/$TO_FILE +	_ak_modules_articles_add $ZARTICLESDIR/$TO_FILE  	echo "Adding to git repo..."  	cd $ZARTICLESDIR  	git add $TO_FILE README @@ -35,7 +35,7 @@ create(){  	git clean --force  	# rm -rf $TEMP   } -index(){ +_ak_modules_articles_index(){  	FILES="$(ls -1 $ZARTICLESDIR)"  	i=0  	for FILE in $FILES @@ -46,11 +46,11 @@ index(){  		let i+=1  	done	  } -title(){ +_ak_modules_articles_title(){  	echo	ak-articles-cli  	echo "--------------"  } -import(){ +_ak_modules_articles_import(){  	echo "#TODO"  	if [ ! -z $1 ]  	then @@ -63,7 +63,7 @@ import(){  			fl="$(ls -1 $1)"  			for f in $fl  			do -				add $1/$f +				_ak_modules_articles_add $1/$f  			done  		fi  	else @@ -72,7 +72,7 @@ import(){  	fi  	exit 224  } -add(){ +_ak_modules_articles_add(){      TEMP="$(ak-tempassin)"      cd $TEMP  	if [ -f $1 ]; then @@ -106,7 +106,7 @@ EOF  		exit 1  	fi  } -usage(){ +_ak_modules_articles_usage(){  	echo "#TODO"  	echo "All you need to know is that there are two options available:"  	echo "help		Prints this help message" @@ -117,15 +117,15 @@ usage(){  	echo "                  articlesletter and it's going to be saved"  	exit 0  } -title +_ak_modules_articles_title  if [ ! -z $1 ]; then  	case $1 in -		help) usage; exit;; -		index) index; exit;; -		import) import $2; exit;; -		add) add $2; exit;; -		create) create; exit;; -		* ) usage;; +		help) _ak_modules_articles_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;;  	esac -else usage +else _ak_modules_articles_usage  fi diff --git a/bin/ak-categories b/bin/ak-categories index ea0965c..47ee69e 100755 --- a/bin/ak-categories +++ b/bin/ak-categories @@ -11,7 +11,7 @@ else  	echo "AK_CATEGORIES found"  fi -create(){ +_ak_modules_categories_create(){      TEMP="$(ak-tempassin)"      cd $TEMP  	export NEWS_FILE="$(date +%Y%m%d_%H%M%S)" @@ -22,10 +22,10 @@ create(){  	IPFS_FILE=$(ak-ipfs-add $NEWS_FILE)  	mv $NEWS_FILE $AK_CATEGORIES/$TO_FILE  	sed -e 's,Qm.*,'"$IPFS_FILE"',g' $AK_CATEGORIES/README -	add $AK_CATEGORIES/$TO_FILE +	_ak_modules_categories_add $AK_CATEGORIES/$TO_FILE  	cd $AK_CATEGORIES  } -index(){ +_ak_modules_categories_index(){  	FILES="$(ls -1 $AK_CATEGORIES)"  	i=0  	for FILE in $FILES @@ -36,11 +36,11 @@ index(){  		let i+=1  	done	  } -title(){ +_ak_modules_categories_title(){      echo "$PROGRAM"  } -import(){ +_ak_modules_categories_import(){  	echo "#TODO"  	if [ ! -z $1 ]  	then @@ -53,7 +53,7 @@ import(){  			fl="$(ls -1 $1)"  			for f in $fl  			do -				add $1/$f +				_ak_modules_categories_add $1/$f  			done  		fi  	else @@ -62,7 +62,7 @@ import(){  	fi  	exit 224  } -add(){ +_ak_modules_categories_add(){      TEMP="$(ak-tempassin)"      cd $TEMP  	if [ -f $1 ]; then @@ -96,7 +96,7 @@ EOF  		exit 1  	fi  } -usage(){ +_ak_modules_categories_usage(){  	echo "#TODO"  	echo "All you need to know is that there are two options available:"  	echo "help		Prints this help message" @@ -107,15 +107,15 @@ usage(){  	echo "                  newsletter and it's going to be saved"  	exit 0  } -title +_ak_modules_categories_title  if [ ! -z $1 ]; then  	case $1 in -		help) usage; exit;; -		index) index; exit;; -		import) import $2; exit;; -		add) add $2; exit;; -		create) create; exit;; -		* ) usage;; +		help) _ak_modules_categories_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;;  	esac -else usage +else _ak_modules_categories_usage  fi diff --git a/bin/ak-comments b/bin/ak-comments index a8016bf..34b83c0 100755 --- a/bin/ak-comments +++ b/bin/ak-comments @@ -9,7 +9,7 @@ else  	ak-logthis "[INFO]" "zcommentsdir found"  fi -create(){ +_ak_modules_comments_create(){  	if [ ! -z $1 ]  	then  		REFER_TO="$1" @@ -26,7 +26,7 @@ create(){  	TO_FILE=$COMMENTS_FILE  	IPFS_FILE=$(ak-ipfs-add $COMMENTS_FILE)  	mv $COMMENTS_FILE $ZCOMMENTSDIR/$TO_FILE -	add $TO_FILE +	_ak_modules_comments_add $TO_FILE  	ak-logthis "[INFO]" "Adding to git repo..."  	cd $ZCOMMENTSDIR  	if [ ! -z $REFER_TO ] @@ -35,7 +35,7 @@ create(){  	fi  } -index(){ +_ak_modules_comments_index(){  	FILES="$(ls -1 $ZCOMMENTSDIR)"  	i=0  	for FILE in $FILES @@ -46,10 +46,10 @@ index(){  		let i+=1  	done	  } -title(){ +_ak_modules_comments_title(){  	echo comments  } -add(){ +_ak_modules_comments_add(){      TEMP="$(ak-tempassin)"      cd $TEMP  	if [ -f "$ZCOMMENTSDIR/$1" ]; then @@ -74,8 +74,8 @@ add(){  		exit 1  	fi  } -usage(){ -	title +_ak_modules_comments_usage(){ +	_ak_modules_comments_title  	echo "All you need to know is that there are two options available:"  	echo ""  	echo "help				Prints this help message" @@ -88,11 +88,11 @@ usage(){  if [ ! -z $1 ]; then  	case $1 in -		help) usage; exit;; -		index) index; exit;; -		add) add $2 $3; exit;; -		create) create $2; exit;; -		* ) usage;; +		help) _ak_modules_comments_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;;  	esac -else usage +else _ak_modules_comments_usage  fi 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 diff --git a/bin/ak-files b/bin/ak-files index 6e36b51..2946856 100755 --- a/bin/ak-files +++ b/bin/ak-files @@ -21,11 +21,11 @@ else  	logit "[INFO]" "$ZFILESDIR found!"  fi -usage(){ +_ak_modules_files_usage(){  	echo "$PROGRAM - file"  } -add(){ +_ak_modules_files_add(){      CRP="$(pwd)"      FILENAME="$1"      main $FILENAME $CRP @@ -103,9 +103,9 @@ echo "Publishing..."  if [ ! -z $1 ]; then  	case $1 in -		help) usage; exit;; -		add) add $2; exit;; -		*) usage; exit;; +		help) _ak_modules_files_usage; exit;; +		add) _ak_modules_files_add $2; exit;; +		*) _ak_modules_files_usage; exit;;  	esac -else usage +else _ak_modules_files_usage  fi diff --git a/bin/ak-folders b/bin/ak-folders index 65ff69f..1049895 100755 --- a/bin/ak-folders +++ b/bin/ak-folders @@ -17,19 +17,19 @@ fi  TEMPASSIN="$(ak-tempassin)"  cd $TEMPASSIN -usage(){ -    title +_ak_modules_folders_usage(){ +    _ak_modules_folders_title      echo "$PROGRAM - folder"  } -add(){ +_ak_modules_folders_add(){      CRP="$(pwd)"      FOLDERNAME="$1" -    main $FOLDERNAME $CRP +    _ak_modules_folders_main $FOLDERNAME $CRP      cat data | jq -M  } -main(){ +_ak_modules_folders_main(){      FOLDERNAME="$1"      CRP="$2"      echo "Adding $FOLDERNAME" @@ -68,7 +68,7 @@ main(){      fi  } -title(){ +_ak_modules_folders_title(){      echo "$PROGRAM"      echo "Folder block creator"  } @@ -76,9 +76,9 @@ title(){  if [ ! -z $1 ]; then      case $1 in -        help) usage; exit;; -        add) add $2; exit;; -        *) usage; exit;; +        help) _ak_modules_folders_usage; exit;; +        add) _ak_modules_folders_add $2; exit;; +        *) _ak_modules_folders_usage; exit;;      esac -else usage +else _ak_modules_folders_usage  fi diff --git a/bin/ak-mixtapes b/bin/ak-mixtapes index adbe52c..8ccabcf 100755 --- a/bin/ak-mixtapes +++ b/bin/ak-mixtapes @@ -2,12 +2,12 @@  # The following creates a mixtape data message  # We can extend it by calling the ak-pack_z_block.sh mixtape/add data ## ORIGINAL LINE -usage(){ -	title +_ak_modules_mixtapes_usage(){ +	_ak_modules_mixtapes_title  	echo "$0 - artist title file"  } -main(){ +_ak_modules_mixtapes_main(){      echo $MIXTAPE_FILE "by" $MIXTAPE_ARTIST "named as" $MIXTAPE_TITLE      MIXTAPE_IPFS_HASH=$(ak-ipfs-add $MIXTAPE_FILE) @@ -29,7 +29,7 @@ EOF  } -title(){ +_ak_modules_mixtapes_title(){      echo "AK mixtape block creator"      echo "========================"  } @@ -41,8 +41,8 @@ then      MIXTAPE_ARTIST="$1"      MIXTAPE_TITLE="$2"      MIXTAPE_FILE="$PWD/$3" -    main +    _ak_modules_mixtapes_main      cat $PWD/data | jq -M      ak-pack_z_block mixtape/add $PWD/data -else usage +else _ak_modules_mixtapes_usage  fi diff --git a/bin/ak-news b/bin/ak-news index 8175aba..d6f0660 100755 --- a/bin/ak-news +++ b/bin/ak-news @@ -22,7 +22,7 @@ fi  cd $ZNEWSDIR -create(){ +_ak_modules_news_create(){      TEMP="$(ak-tempassin)"      cd $TEMP      cd  @@ -35,12 +35,12 @@ create(){      IPFS_FILE=$(ak-ipfs-add $NEWS_FILE)      mv $NEWS_FILE $ZNEWSDIR/$TO_FILE      sed -e 's,Qm.*,'"$IPFS_FILE"',g' $ZNEWSDIR/README -    add $TO_FILE +    _ak_modules_news_add $TO_FILE      echo "Adding to git repo..."      cd $ZNEWSDIR      # rm -rf $TEMP   } -index(){ +_ak_modules_news_index(){      FILES="$(ls -1 $ZNEWSDIR)"      i=0      ak-get-ipfs-hashes-from-my-zchain | sort | uniq > temp @@ -61,10 +61,10 @@ index(){      done          rm temp  } -title(){ +_ak_modules_news_title(){      echo $PROGRAM  } -import(){ +_ak_modules_news_import(){      echo "#TODO"      if [ ! -z $1 ]      then @@ -79,7 +79,7 @@ import(){              for f in $fl              do                  echo $1 $f -                add2 "$1/$f" +                _ak_modules_news_add2 "$1/$f"              done          fi      else @@ -88,7 +88,7 @@ import(){      fi      exit 224  } -add2(){ +_ak_modules_news_add2(){      TEMP="$(ak-tempassin)"      if [ -f "$1" ]; then          FILE="$(realpath $1)" @@ -126,7 +126,7 @@ EOF      fi      rm -rf $TEMP  } -add(){ +_ak_modules_news_add(){      TEMP="$(ak-tempassin)"      cd $TEMP      if [ -f $ZNEWSDIR/$1 ]; then @@ -160,7 +160,7 @@ EOF          exit 1      fi  } -usage(){ +_ak_modules_news_usage(){      echo "#TODO"      echo "All you need to know is that there are two options available:"      echo "help        Prints this help message" @@ -171,7 +171,7 @@ usage(){      echo "                  newsletter and it's going to be saved"      exit 0  } -akNewsRead(){ +_ak_modules_news_read(){      ak-enter -l 1 $1 > temp      if [ $? -ne 0 ]      then @@ -194,16 +194,16 @@ akNewsRead(){      fi      rm temp  } -title +_ak_modules_news_title  if [ ! -z $1 ]; then      case $1 in -        help) usage; exit;; -        local-index) index; exit;; -        import) import $2; exit;; -        add) add2 $2; exit;; -        create) create; exit;; -        read) akNewsRead $2; exit;; -        * ) usage;; +        help) _ak_modules_news_usage; exit;; +        local-index) _ak_modules_news_index; exit;; +        import) _ak_modules_news_import $2; exit;; +        add) _ak_modules_news_add2 $2; exit;; +        create) _ak_modules_news_create; exit;; +        read) _ak_modules_news_read $2; exit;; +        * ) _ak_modules_news_usage;;      esac -else usage +else _ak_modules_news_usage  fi diff --git a/bin/ak-profile b/bin/ak-profile index da04003..a70ffe4 100755 --- a/bin/ak-profile +++ b/bin/ak-profile @@ -24,7 +24,7 @@ fi  # The profile settings/configuration is part of the blockchain produced.  # Hence, we need a specific DATA block that actually has the announcement of a  # {"key":"value"} pair. -show(){ +_ak_modules_profile_show(){  	if [ ! -z $1 ]  	then  		logit "[INFO]" "Working with $1" @@ -37,7 +37,7 @@ show(){  # This should retrieve a specific value from our profile otherwise it dumps the  # whole profile values. -propget(){ +_ak_modules_profile_propget(){  	if [ ! -z $1 ]  	then  		if [ ! -f $ZPROFILEDIR/$1 ] @@ -48,7 +48,7 @@ propget(){  		fi  	else  		echo "No particular property... indexing" -		index +		_ak_modules_profile_index  	fi  } @@ -63,7 +63,7 @@ EOF  		echo "Added successfully... proceeding"  		IPFS_FILE=$(ak-ipfs-add $ZPROPERTY_FILE)  		echo "Prop writting,,, $IPFS_FILE" -		add $ZPROPERTY_KEY +		_ak_modules_profile_add $ZPROPERTY_KEY  		cd $ZPROFILEDIR  	else  		echo "Couldn't write to file $ZPROFILEDIR/$TO_FILE" @@ -71,7 +71,7 @@ EOF  	fi  } -propset(){ +_ak_modules_profile_propset(){  	if [ ! -z $1 ]  	then  		ZPROPERTY_FILE="$ZPROFILEDIR/$1" @@ -99,14 +99,14 @@ propset(){  				* ) echo "Answer please";;  			esac  			echo $IPFS_FILE -			show $IPFS_FILE +			_ak_modules_profile_show $IPFS_FILE  		fi  	else  		echo "conditions unmet"  		exit 244  	fi  } -index(){ +_ak_modules_profile_index(){  	FILES="$(ls -1 $ZPROFILEDIR)"  	i=0  	echo -n "{" @@ -124,7 +124,7 @@ index(){  	done  	echo "}"  } -import(){ +_ak_modules_profile_import(){  	if [ ! -z $1 ]  	then  		if [ ! -d $1 ] @@ -136,7 +136,7 @@ import(){  			fl="$(ls -1 $1)"  			for f in $fl  			do -				add $1/$f +				_ak_modules_profile_add $1/$f  			done  		fi  	else @@ -147,7 +147,7 @@ import(){  }  # Adds a file as a profile/add ACTION on the zchain. -add(){ +_ak_modules_profile_add(){      TEMP="$(ak-tempassin)"      cd $TEMP  	if [ -f $ZPROFILEDIR/$1 ]; then @@ -179,7 +179,7 @@ EOF      cd $ZPROFILEDIR      rm -rf "$TEMPASSIN"  } -usage(){ +_ak_modules_profile_usage(){  	echo "Usage:"  	echo "		$PROGRAM command [options]"  	echo "" @@ -200,14 +200,14 @@ usage(){  }  if [ ! -z $1 ]; then  	case $1 in -		help) usage; exit;; -		index) index; exit;; -		show) show $2; exit;; -		import) import $2; exit;; -		add) add $2; exit;; -		set) propset $2 "$3"; exit;; -		get) propget $2; exit;; -		* ) usage;; +		help) _ak_modules_profile_usage; exit;; +		index) _ak_modules_profile_index; exit;; +		show) _ak_modules_profile_show $2; exit;; +		import) _ak_modules_profile_import $2; exit;; +		add) _ak_modules_profile_add $2; exit;; +		set) _ak_modules_profile_propset $2 "$3"; exit;; +		get) _ak_modules_profile_propget $2; exit;; +		* ) _ak_modules_profile_usage;;  	esac -else usage +else _ak_modules_profile_usage  fi diff --git a/bin/ak-reference b/bin/ak-reference index f86983e..6f24e87 100755 --- a/bin/ak-reference +++ b/bin/ak-reference @@ -10,7 +10,7 @@ else      ak-logthis "zreferencesdir found"  fi -create(){ +_ak_modules_reference_create(){      TEMP="$(ak-tempassin)"      cd $TEMP      export REFERENCEFILE="$(date -u +%s)" @@ -32,10 +32,10 @@ EOF      echo $TO_FILE      IPFS_FILE=$(ak-ipfs-add $ZREFERENCESDIR/$TO_FILE)      sed -e 's,Qm.*,'"$IPFS_FILE"',g' $ZREFERENCESDIR/README -    add $ZREFERENCESDIR/$TO_FILE +    _ak_modules_reference_add $ZREFERENCESDIR/$TO_FILE      cd $ZREFERENCESDIR  } -index(){ +_ak_modules_reference_index(){      FILES="$(ls -1 $ZREFERENCESDIR)"      i=0      for FILE in $FILES @@ -47,11 +47,11 @@ index(){          let i+=1      done      } -title(){ +_ak_modules_reference_title(){      echo ak-references-cli      echo "--------------"  } -import(){ +_ak_modules_reference_import(){      echo "#TODO"      if [ ! -z $1 ]      then @@ -64,7 +64,7 @@ import(){              fl="$(ls -1 $1)"              for f in $fl              do -                add $1/$f +                _ak_modules_reference_add $1/$f              done          fi      else @@ -73,7 +73,7 @@ import(){      fi      exit 224  } -add(){ +_ak_modules_reference_add(){      TEMP="$(ak-tempassin)"      cd $TEMP      if [ ! -f $1 ]; then @@ -108,8 +108,8 @@ EOF      echo "References added successfully"  } -usage(){ -    title +_ak_modules_reference_usage(){ +    _ak_modules_reference_title      echo "#TODO"      echo "All you need to know is that there are two options available:"      echo "help                     Prints this help message" @@ -123,12 +123,12 @@ usage(){  if [ ! -z $1 ]; then      case $1 in -        help) usage; exit;; -        index) index; exit;; -        import) import $2; exit;; -        add) add $2; exit;; -        create) create $2 $3; exit;; -        * ) usage;; +        help) _ak_modules_reference_usage; exit;; +        index) _ak_modules_reference_index; exit;; +        import) _ak_modules_reference_import $2; exit;; +        add) _ak_modules_reference_add $2; exit;; +        create) _ak_modules_reference_create $2 $3; exit;; +        * ) _ak_modules_reference_usage;;      esac -else usage +else _ak_modules_reference_usage  fi diff --git a/bin/ak-todos b/bin/ak-todos index 35cfeda..2df403d 100755 --- a/bin/ak-todos +++ b/bin/ak-todos @@ -14,7 +14,7 @@ else  	ak-logthis "ztodosdir found"  fi -create(){ +_ak_modules_todos_create(){      TEMP="$(ak-tempassin)"      cd $TEMP  	export TODOS_FILE="$(date -u +%s)" @@ -25,7 +25,7 @@ create(){  	IPFS_FILE=$(ak-ipfs-add $TODOS_FILE)  	mv $TODOS_FILE $ZTODOSDIR/$TO_FILE  	sed -e 's,Qm.*,'"$IPFS_FILE"',g' $ZTODOSDIR/README -	add $ZTODOSDIR/$TO_FILE +	_ak_modules_todos_add $ZTODOSDIR/$TO_FILE  	ak-logthis "Adding to git repo..."  	cd $ZTODOSDIR  	git add $TO_FILE README @@ -33,7 +33,7 @@ create(){  	git clean --force  	# rm -rf $TEMP   } -index(){ +_ak_modules_todos_index(){  	FILES="$(ls -1 $ZTODOSDIR)"  	i=0  	for FILE in $FILES @@ -44,11 +44,11 @@ index(){  		let i+=1  	done  } -title(){ +_ak_modules_todos_title(){  	echo	ak-todos-cli  	echo "--------------"  } -import(){ +_ak_modules_todos_import(){  	echo "#TODO"  	if [ ! -z $1 ]  	then @@ -61,7 +61,7 @@ import(){  			fl="$(ls -1 $1)"  			for f in $fl  			do -				add $1/$f +				_ak_modules_todos_add $1/$f  			done  		fi  	else @@ -70,7 +70,7 @@ import(){  	fi  	exit 224  } -add(){ +_ak_modules_todos_add(){      TEMP="$(ak-tempassin)"      cd $TEMP  	if [ -f $1 ]; then @@ -104,8 +104,8 @@ EOF  		exit 1  	fi  } -usage(){ -	title +_ak_modules_todos_usage(){ +	_ak_modules_todos_title  	echo "#TODO"  	echo "All you need to know is that there are two options available:"  	echo "help		Prints this help message" @@ -118,12 +118,12 @@ usage(){  }  if [ ! -z $1 ]; then  	case $1 in -		help) usage; exit;; -		index) index; exit;; -		import) import $2; exit;; -		add) add $2; exit;; -		create) create; exit;; -		* ) usage;; +		help) _ak_modules_todos_usage; exit;; +		index) _ak_modules_todos_index; exit;; +		import) _ak_modules_todos_import $2; exit;; +		add) _ak_modules_todos_add $2; exit;; +		create) _ak_modules_todos_create; exit;; +		* ) _ak_modules_todos_usage;;  	esac -else usage +else _ak_modules_todos_usage  fi diff --git a/bin/ak-transactions b/bin/ak-transactions index 4dd659c..221b4fd 100755 --- a/bin/ak-transactions +++ b/bin/ak-transactions @@ -1,6 +1,6 @@  #!/bin/bash  PROGRAM="$(basename $0)" -usage(){ +_ak_modules_transactions_usage(){  	echo "$PROGRAM from to amount"  } @@ -8,7 +8,7 @@ logit(){  	ak-logthis "<$PROGRAM>" "$1" "$2"  } -main(){ +_ak_modules_transactions_main(){      logit "[INFO]" "$FROM_ADDRESS to $TO_ADDRESS value sent: $AMOUNT"      cat > transaction_file <<EOF  $FROM_ADDRESS @@ -43,8 +43,8 @@ then      FROM_ADDRESS="$1"      TO_ADDRESS="$2"      AMOUNT="$3" -    main +    _ak_modules_transactions_main      cat $PWD/data | jq -M      ak-pack_z_block transaction/add $PWD/data -else usage +else _ak_modules_transactions_usage  fi | 
