From e6cd7877d16facced90091bd832883bf991b9c5e Mon Sep 17 00:00:00 2001 From: Alessio Greggi Date: Fri, 10 Jan 2025 16:22:04 +0100 Subject: [PATCH] docs: update tutorial with -E flag for env vars Signed-off-by: Alessio Greggi --- docs/tutorials.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/tutorials.md b/docs/tutorials.md index af65bec..cce7c81 100644 --- a/docs/tutorials.md +++ b/docs/tutorials.md @@ -88,6 +88,18 @@ To do so, you have the `--dump-interval/-i` flag available. This flag gives you harpoon capture -f main.main --dump-interval 2 -- ./binary_name ``` +## Tracing a program that requires environment variables to run + +`harpoon` provides support to pass environment variables to the executed command. + +This is really useful to trace the command changing its behaviour through env vars. + +Here's how you can pass multiple env vars to the executed command: + +```sh +harpoon capture -f main.main -E "VAR1=value1" -E "VAR2=value2" -- ./binary_name +``` + ## Tracing from unit-tests `harpoon` has additional commands other than `capture`. The commands are `analyze` and `hunt`.