command for direct API call
This commit is contained in:
parent
02df26d5ea
commit
e41b233ca3
37
miria-api
Executable file
37
miria-api
Executable file
@ -0,0 +1,37 @@
|
||||
################################################################################
|
||||
# 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 -
|
Loading…
Reference in New Issue
Block a user