Skip to content

Commit

Permalink
add debug function
Browse files Browse the repository at this point in the history
Signed-off-by: Matthias Gatto <[email protected]>
  • Loading branch information
outscale-mgo committed Dec 24, 2024
1 parent 11e05a7 commit 635c08d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ config.sh:
echo "alias json-search=$(JSON_SEARCH)" > config.sh
echo $(SED_ALIAS) >> config.sh
echo "export CLI_NAME=$(CLI_NAME)" >> config.sh
echo -e "debug()\n{" >> config.sh
echo -e '\tif [[ "$$DEBUG_MODE" == "1" ]] ; then echo "$$@" >&2 ; fi\n}' >> config.sh
echo export DEBUG_MODE=$(DEBUG_MODE) >> config.sh
echo 'debug "debug mode is on"' >> config.sh

call_list: osc-api.json bin/funclist
bin/funclist osc-api.json $(FUNCLIST_ARG) > call_list
Expand Down
4 changes: 4 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ for arg in $@; do
--wget-json-search wget json-search.Appimage
--gnu-sed-alias use gsed for sed
--cli-name=Name set cli name, default: oapi-cli
--debug-mode enable debug in cognac (output on stderr)
--api-script=script how to generate osc-api.json
--yq-go use go version of yq, that use diferents arguments
--curl-path=PATH path to curl source root
Expand Down Expand Up @@ -68,6 +69,8 @@ EOF
YQ_ARG="-o json"
elif [ "--gnu-sed-alias" = $arg ]; then
SED_ALIAS="'alias sed=gsed'"
elif [ "--debug-mode" = $arg ]; then
DEBUG_MODE=1
elif [ "--target-api" = $( echo "$arg" | cut -d '=' -f 1) ]; then
API_VERSION=$( echo $arg | cut -f 2 -d '=' )
elif [ "--cli-name" = $( echo "$arg" | cut -d '=' -f 1) ]; then
Expand Down Expand Up @@ -114,6 +117,7 @@ echo JSON_C_CFLAGS=$JSON_C_CFLAGS >> config.mk
echo JSON_C_RULE=$JSON_C_RULE >> config.mk
echo API_VERSION=$API_VERSION >> config.mk
echo CLI_NAME=$CLI_NAME >> config.mk
echo DEBUG_MODE=$DEBUG_MODE >> config.mk
echo -e "osc-api.json:: config.sh\n\t$API_SCRIPT" >> config.mk
echo $SDK_VERSION > sdk-version
echo "config done:"
Expand Down

0 comments on commit 635c08d

Please sign in to comment.