From ae30c285a23240211c4641832cec42905e5be328 Mon Sep 17 00:00:00 2001 From: Markus Napp Date: Sun, 12 Mar 2017 15:45:11 +0100 Subject: [PATCH 1/4] Fix handling of wildcard help text --- advanced/Scripts/list.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/advanced/Scripts/list.sh b/advanced/Scripts/list.sh index 2ac1e805..a094becb 100755 --- a/advanced/Scripts/list.sh +++ b/advanced/Scripts/list.sh @@ -31,13 +31,16 @@ helpFunc() { if [[ ${listMain} == ${whitelist} ]]; then letter="w" word="white" + elif [[ ${listMain} == ${wildcardlist} ]]; then + letter="wild" + word="wildcard" else letter="b" word="black" fi cat << EOM -::: Immediately ${word}lists one or more domains in the hosts file +::: Immediately add one or more domains to the ${word}list ::: ::: Usage: pihole -${letter} domain1 [domain2 ...] ::: @@ -48,7 +51,7 @@ helpFunc() { ::: -h, --help Show this help dialog ::: -l, --list Display your ${word}listed domains EOM -if [[ "${letter}" == "b" ]]; then +if [[ "${letter}" == "-wild" ]]; then echo "::: -wild, --wildcard Add wildcard entry (only blacklist)" fi exit 0 From 9a475cc0107c263e814a17acd676a3f8f7ef68e1 Mon Sep 17 00:00:00 2001 From: Markus Napp Date: Sun, 12 Mar 2017 15:50:48 +0100 Subject: [PATCH 2/4] Rewrite help text for better handling of params --- advanced/Scripts/list.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/advanced/Scripts/list.sh b/advanced/Scripts/list.sh index a094becb..a4611a4a 100755 --- a/advanced/Scripts/list.sh +++ b/advanced/Scripts/list.sh @@ -49,9 +49,9 @@ helpFunc() { ::: -nr, --noreload Update ${word}list without refreshing dnsmasq ::: -q, --quiet Output is less verbose ::: -h, --help Show this help dialog -::: -l, --list Display your ${word}listed domains +::: -l, --list Display domains on the ${word}list EOM -if [[ "${letter}" == "-wild" ]]; then +if [[ "${letter}" == "wild" ]]; then echo "::: -wild, --wildcard Add wildcard entry (only blacklist)" fi exit 0 From bb7a7d94efe54b27e9e58af6c42314b6c45e4723 Mon Sep 17 00:00:00 2001 From: Markus Napp Date: Sun, 12 Mar 2017 16:16:45 +0100 Subject: [PATCH 3/4] Replace misleading letter variable --- advanced/Scripts/list.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/advanced/Scripts/list.sh b/advanced/Scripts/list.sh index a4611a4a..8eb0543d 100755 --- a/advanced/Scripts/list.sh +++ b/advanced/Scripts/list.sh @@ -29,20 +29,20 @@ listAlt="" helpFunc() { if [[ ${listMain} == ${whitelist} ]]; then - letter="w" + param="w" word="white" elif [[ ${listMain} == ${wildcardlist} ]]; then - letter="wild" + param="wild" word="wildcard" else - letter="b" + param="b" word="black" fi cat << EOM ::: Immediately add one or more domains to the ${word}list ::: -::: Usage: pihole -${letter} domain1 [domain2 ...] +::: Usage: pihole -${param} domain1 [domain2 ...] ::: ::: Options: ::: -d, --delmode Remove domains from the ${word}list @@ -51,7 +51,7 @@ helpFunc() { ::: -h, --help Show this help dialog ::: -l, --list Display domains on the ${word}list EOM -if [[ "${letter}" == "wild" ]]; then +if [[ "${param}" == "wild" ]]; then echo "::: -wild, --wildcard Add wildcard entry (only blacklist)" fi exit 0 From 7453bf2ee62dfb9c79384ef43856a7446e4173da Mon Sep 17 00:00:00 2001 From: WaLLy3K Date: Tue, 16 May 2017 10:23:53 +1000 Subject: [PATCH 4/4] Fix wildcard help text * -wild is not a valid option since we're already using -wild --- advanced/Scripts/list.sh | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/advanced/Scripts/list.sh b/advanced/Scripts/list.sh index 378d8402..308e1f5e 100755 --- a/advanced/Scripts/list.sh +++ b/advanced/Scripts/list.sh @@ -40,13 +40,8 @@ helpFunc() { Example: 'pihole -${param} site.com', or 'pihole -${param} site1.com site2.com' ${type^}list one or more domains -Options:" - - if [[ "${listMain}" == "${wildcardlist}" ]]; then - echo " -wild, --wildcard Block all subdomains of specified domain" - fi - -echo " -d, --delmode Remove domain(s) from the ${type}list +Options: + -d, --delmode Remove domain(s) from the ${type}list -nr, --noreload Update ${type}list without refreshing dnsmasq -q, --quiet Make output less verbose -h, --help Show this help dialog