From 1e016904fa37c4bc3673dbafa4b9f89fd3db3d1d Mon Sep 17 00:00:00 2001 From: kaotisk Date: Sun, 5 Jun 2022 01:30:32 +0300 Subject: New flags and help --- bin/enter | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/bin/enter b/bin/enter index 0b74231..3d1897c 100755 --- a/bin/enter +++ b/bin/enter @@ -1,15 +1,28 @@ #!/bin/bash - +usage(){ + echo "enter - Crawl an arching kaos chain" + echo "-----------------------------------" + echo "Usage:" + echo " --help, -h Print this help and exit" + echo " --chain , -n Crawl specified chain" + echo " --show-zblocks-only, -z Show only zblocks" + echo "" + echo "Note that combined flags don't work for now" + echo "Running with no flags crawls your chain" +} # Start of tests #entrance="QmW5WVXCJfhb4peHG6cbEdamC24vZzMX2Vz386vpENh38U" #entrance="QmNjQq7GkuXGF8kFT1z2Mv3i4JhY7sBXVUmHDiR1zkQjoE" #entrance="QmbFMke1KXqnYyBBWxB74N4c5SBnJMVAiMNRcGu6x1AwQH" # End of tests - -if [ ! -z "$1" ] && [ "$1" == "-n" ] +if [ ! -z "$1" ] && [ "$1" == "-h" ] || [ "$1" == "--help" ] +then + usage + exit +elif [ ! -z "$1" ] && [ "$1" == "-n" ] then entrance="$(ipns-resolve $2)" -elif [ ! -z "$1" ] && [ "$1" == "--show-zblocks-only" ] +elif [ ! -z "$1" ] && [ "$1" == "--show-zblocks-only" ] || [ "$1" == "-z" ] then # Enter temp folder TEMPASSIN="/tmp/aktmp_$(date -u +%s)" -- cgit v1.2.3