miria-cli/miria-api

38 lines
1.2 KiB
Plaintext
Executable File

################################################################################
# Copyright 2022 Antonin Portelli
#
# This file is part of miria-cli.
#
# miria-cli is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation, either version 3 of the License, or (at your option) any
# later version.
#
# miria-cli is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with
# miria-cli. If not, see <https://www.gnu.org/licenses/>.
################################################################################
#!/usr/bin/env bash
set -uoe pipefail
script_dir=$(dirname $(readlink -f $0))
source ${script_dir}/functions.sh
print_usage() {
echo "usage: $(basename $0) <command> <arg1=val1> ... <argn=valn>" 1>&2
}
if (( $# < 1 )); then
print_usage
exit 1
fi
cmd="$1"
shift
miria_api_cmd "${cmd}" "$@"
echo ${miria_last_xml} | xmllint --format -