Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct dogwrap docstrings #815

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions datadog/dogshell/wrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@

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
instead of the wrapped command.

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:

Expand Down Expand Up @@ -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 \
Expand Down