Skip to content

Instantly share code, notes, and snippets.

@dragonee
Created March 14, 2022 08:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dragonee/2f6a2eeec515cee34afaab55c36357b0 to your computer and use it in GitHub Desktop.
Save dragonee/2f6a2eeec515cee34afaab55c36357b0 to your computer and use it in GitHub Desktop.
Docopt example
"""
Wait for a specific process to finish, then notify via Pushover API.
Usage:
notify-on-exit [options] PID [MESSAGE]
Options:
-p High priority (this message will pop on the phone).
-b Run in the background.
--version Show version information.
-h, --help Show this message.
"""
VERSION = '1.0'
from docopt import docopt
# [...]
def main():
arguments = docopt(__doc__, version=VERSION)
pid = int(arguments['PID'])
# [...]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment