From 11a2101f6040ed9a9bed65206eb1ecca7b194f5f Mon Sep 17 00:00:00 2001 From: Liam Zhang <33468366+liamzhang40@users.noreply.github.com> Date: Fri, 19 Jan 2024 21:58:20 -0500 Subject: [PATCH 1/2] correct dogwrap docstrings --- datadog/dogshell/wrap.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/datadog/dogshell/wrap.py b/datadog/dogshell/wrap.py index 25df6d961..a327b7abc 100644 --- a/datadog/dogshell/wrap.py +++ b/datadog/dogshell/wrap.py @@ -5,7 +5,7 @@ Wraps shell commands and sends the result to Datadog as events. Ex: -dogwrap -n test-job -k $API_KEY --submit_mode all "ls -lah" +dogwrap -n test-job -k $API_KEY --submit_mode=all "ls -lah" Note that you need to enclose your command in quotes to prevent python from thinking the command line arguments belong to the python command @@ -13,7 +13,7 @@ You can also have the script only send events if they fail: -dogwrap -n test-job -k $API_KEY --submit_mode errors "ls -lah" +dogwrap -n test-job -k $API_KEY --submit_mode=errors "ls -lah" And you can give the command a timeout too: From 1da312b297c74e017a063b8c09f73e50c20077d8 Mon Sep 17 00:00:00 2001 From: Liam Zhang <33468366+liamzhang40@users.noreply.github.com> Date: Fri, 19 Jan 2024 22:14:30 -0500 Subject: [PATCH 2/2] fix Usage docstring --- datadog/dogshell/wrap.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datadog/dogshell/wrap.py b/datadog/dogshell/wrap.py index a327b7abc..a709791b0 100644 --- a/datadog/dogshell/wrap.py +++ b/datadog/dogshell/wrap.py @@ -254,7 +254,7 @@ def parse_options(raw_args=None): Parse the raw command line options into an options object and the remaining command string """ parser = optparse.OptionParser( - usage='%prog -n [event_name] -k [api_key] --submit_mode \ + usage='%prog -n [event_name] -k [api_key] --submit_mode=\ [ all | errors | warnings] [options] "command". \n\nNote that you need to enclose your command in \ quotes to prevent python executing as soon as there is a space in your command. \n \nNOTICE: In \ normal mode, the whole stderr is printed before stdout, in flush_live mode they will be mixed but \