From 1af14125a553a089248379003b9d463e4beeee79 Mon Sep 17 00:00:00 2001 From: Felix Lohmeier Date: Mon, 4 Apr 2022 22:49:21 +0200 Subject: [PATCH] addendum to #16 --- orcli | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/orcli b/orcli index f5133f3..0962f40 100755 --- a/orcli +++ b/orcli @@ -1,13 +1,15 @@ #!/usr/bin/env bash -# This script was generated by bashly 0.7.8 (https://bashly.dannyb.co) +# This script was generated by bashly 0.7.9 (https://bashly.dannyb.co) # Modifying it manually is not recommended -# :script.bash3_bouncer +# :wrapper.bash3_bouncer if [[ "${BASH_VERSINFO:-0}" -lt 4 ]]; then printf "bash version 4 or higher is required\n" exit 1 fi +# :command.master_script + # :command.version_command version_command() { echo "$version" @@ -185,16 +187,16 @@ inspect_args() { } # :command.user_lib -# :src/lib/error.sh -#!/usr/bin/env bash +# src/lib/error.sh # log error message to STDERR +# shellcheck shell=bash function error() { echo >&2 "[$(date +'%Y-%m-%dT%H:%M:%S')]: ERROR $*" } -# :src/lib/get_csrf.sh -#!/usr/bin/env bash +# src/lib/get_csrf.sh # get CSRF token (introduced in OpenRefine 3.3) +# shellcheck shell=bash function get_csrf() { if [[ "${OPENREFINE_CSRF}" == true ]]; then local response @@ -207,9 +209,9 @@ function get_csrf() { fi } -# :src/lib/get_id.sh -#!/usr/bin/env bash +# src/lib/get_id.sh # get project id (derived from project name if needed) +# shellcheck shell=bash disable=SC2154 function get_id() { local response local projects @@ -234,16 +236,16 @@ function get_id() { # :command.command_functions # :command.function orcli_info_command() { - # :src/info_command.sh - #!/usr/bin/env bash + # src/info_command.sh + # shellcheck shell=bash get_id } # :command.function orcli_list_command() { - # :src/list_command.sh - #!/usr/bin/env bash + # src/list_command.sh # get all project metadata and reshape json to print a list + # shellcheck shell=bash if ! response="$(curl -fs --get "${OPENREFINE_URL}/command/core/get-all-project-metadata")"; then error "no OpenRefine reachable/running at ${OPENREFINE_URL}" else @@ -253,7 +255,7 @@ orcli_list_command() { # :command.parse_requirements parse_requirements() { - # :command.fixed_flag_filter + # :command.fixed_flags_filter case "${1:-}" in --version | -v ) version_command @@ -335,7 +337,7 @@ parse_requirements() { # :command.parse_requirements orcli_info_parse_requirements() { - # :command.fixed_flag_filter + # :command.fixed_flags_filter case "${1:-}" in --help | -h ) long_usage=yes @@ -386,7 +388,7 @@ orcli_info_parse_requirements() { # :command.parse_requirements orcli_list_parse_requirements() { - # :command.fixed_flag_filter + # :command.fixed_flags_filter case "${1:-}" in --help | -h ) long_usage=yes @@ -431,8 +433,8 @@ initialize() { long_usage='' set -e - # :src/initialize.sh - #!/usr/bin/env bash + # src/initialize.sh + # shellcheck shell=bash } # :command.run