Rename --unfiltered to --all
This commit is contained in:
@@ -12,10 +12,10 @@ List available DNS zones.
|
||||
|
||||
Options:
|
||||
-c, --config path to config file
|
||||
-h, --help print this help message
|
||||
-j, --json print json format
|
||||
-J, --json-pretty print pretty json format (implies -j)
|
||||
-r, --raw print raw format
|
||||
-h, --help print this help message
|
||||
|
||||
EOF
|
||||
exit
|
||||
|
||||
@@ -11,24 +11,24 @@ Usage: $SCRIPT [OPTIONS]... ZONE[@VIEW]
|
||||
Show DNS zone content.
|
||||
|
||||
Options:
|
||||
-a, --all do not ignore unsupported record types
|
||||
-c, --config path to config file
|
||||
-h, --help print this help message
|
||||
-i, --interactive interactively ask for missing arguments
|
||||
-j, --json print json format
|
||||
-J, --json-pretty print pretty json format (implies -j)
|
||||
-r, --raw print raw format
|
||||
-u, --unfiltered also print not supported record types
|
||||
|
||||
EOF
|
||||
exit
|
||||
}
|
||||
|
||||
all=false
|
||||
config_file="/etc/dns-manager/config.sh"
|
||||
interactive=false
|
||||
json=false
|
||||
json_pretty=false
|
||||
raw=false
|
||||
unfiltered=false
|
||||
zone=""
|
||||
|
||||
declare -a args=()
|
||||
@@ -36,6 +36,9 @@ while [ -n "$1" ]; do
|
||||
opt=$1
|
||||
shift
|
||||
case "$opt" in
|
||||
-a|--all)
|
||||
all=true
|
||||
;;
|
||||
-c|--config)
|
||||
if [ -z "$1" ]; then
|
||||
echo "$SCRIPT: missing argument to option -- '$opt'" >&2
|
||||
@@ -60,9 +63,6 @@ while [ -n "$1" ]; do
|
||||
-r|--raw)
|
||||
raw=true
|
||||
;;
|
||||
-u|--unfiltered)
|
||||
unfiltered=true
|
||||
;;
|
||||
-*)
|
||||
echo "$SCRIPT: invalid option -- '$opt'" >&2
|
||||
exit 1
|
||||
@@ -108,7 +108,7 @@ else
|
||||
fi
|
||||
|
||||
for view in "${views[@]}"; do
|
||||
output["$view"]=$(dns_zone "$zone" "$view" "$unfiltered") || exit 12
|
||||
output["$view"]=$(dns_zone "$zone" "$view" "$all") || exit 12
|
||||
done
|
||||
|
||||
if $raw; then
|
||||
|
||||
@@ -207,7 +207,7 @@ dns_zone_views() {
|
||||
dns_zone() {
|
||||
local zone=$1
|
||||
local view=$2
|
||||
local unfiltered=${3:-false}
|
||||
local all=${3:-false}
|
||||
|
||||
local keyfile
|
||||
_get_keyfile keyfile "$zone" "$view" || return $?
|
||||
@@ -234,7 +234,7 @@ dns_zone() {
|
||||
local query='.'
|
||||
local rtypes="[]"
|
||||
|
||||
if ! $unfiltered; then
|
||||
if ! $all; then
|
||||
query='[ .[] | select(.type | IN($rtypes[])) ]'
|
||||
rtypes=$(printf "%s\n" "${DNS_RECORD_TYPES[@]}" | bash_array_to_json)
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user