include output parameter

This commit is contained in:
Hugoren Martinako 2024-02-22 12:30:57 +01:00
parent 6d5ec0c4ed
commit 8f3edcc7c8
1 changed files with 7 additions and 1 deletions

View File

@ -13,6 +13,7 @@ function usage() {
-t, --timeout~Query timeout in seconds (default: 900)
-n, --name~Output filename
-s, --server~Overpass server (default: https://overpass-api.de/api)
-o, --output~Output format (default: xml)
~
EOF
@ -35,6 +36,7 @@ provinces=()
areaexpr=
name=
query=$1
output="xml"
# move the file argument, to parse the rest of options
shift
@ -57,6 +59,10 @@ while true; do
name=$2
shift 2
;;
-o|--output)
output=$2
shift 2
;;
-p|--provinces)
# presets for group elements all in once
if [[ "${2,,}" == "ccaa" ]]; then
@ -97,7 +103,7 @@ function province() {
esac
cat <<EOF
[out:xml][timeout:${timeout}];
[out:${output}][timeout:${timeout}];
${area}->.searchArea;
${content_scoped}
out meta;