From a178d193603f5e58112ebbfa738fe51f623d460e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roberto=20Abdelkader=20Mart=C3=ADnez=20P=C3=A9rez?= Date: Wed, 22 Apr 2020 10:26:29 +0200 Subject: [PATCH] doc: Debugging bash example --- docs/source/examples/working_with_pow_files.rst | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/source/examples/working_with_pow_files.rst b/docs/source/examples/working_with_pow_files.rst index b93acbd..8110fa2 100644 --- a/docs/source/examples/working_with_pow_files.rst +++ b/docs/source/examples/working_with_pow_files.rst @@ -108,3 +108,17 @@ In order to be able to debug user request executions, the server subcommand has a ``--debug`` option flag that redirects the script standard output and standard error to Kapow! standard output, so you can use ``set -x`` at the beginning of the script the same way as in pow files. + + +.. code-block:: console + + $ cat withdebug.pow + #!/usr/bin/env bash + + kapow route add / - <<-'EOF' + set -x + echo "This will be seen in the log" + echo "Hi HTTP" | kapow set /response/body + EOF + + $ kapow server --debug withdebug.pow