#!/usr/bin/env bash
# opensim save: save an inventory or region archive through a running simulator.

USAGE='opensim save iar|oar [GRID [SIMULATOR|REGION]] [--region "REGION NAME"] [--all] [--keep N] [--home URL] [--noassets] [--perm PERMISSIONS] [--skipbadassets] [--publish] ...
       GRID: the nick of a grid or its name'
HELP="Save an inventory (IAR) or region (OAR) archive through a running simulator console."

# The options are the ones of the archives of OpenSimulator (-h the home URL, -v verbose): only a first -h or a --help is the help
arguments=("$@")
[[ "${1:-}" == -h || " $* " == *" --help "* ]] || set --
source "$(dirname "$(realpath "${BASH_SOURCE[0]}" 2>/dev/null || echo "${BASH_SOURCE[0]}")")/../src/lib/common"

run save ${arguments[@]+"${arguments[@]}"}
