Created
August 24, 2015 20:51
-
-
Save Lucas-C/4f466b14061c5fbfbbd8 to your computer and use it in GitHub Desktop.
Patch to document the changes detailed in https://github.com/amoffat/sh/issues/269
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- index.txt 2015-08-24 22:48:41.587933500 +0200 | |
+++ index.txt.new 2015-08-24 22:41:03.269527000 +0200 | |
@@ -381,6 +381,20 @@ | |
print(myserver.tail("/var/log/dumb_daemon.log", n=100)) | |
+.. _special_arguments_defaults: | |
+ | |
+Special arguments defaults | |
+-------------------------- | |
+ | |
+You can set the default values of all the :ref:`special keyword argument <special_arguments>`, | |
+by using the `defaults` context manager: | |
+ | |
+ import sh, sys | |
+ with sh.defaults(_out=sys.stdout): | |
+ from sh import echo | |
+ echo('HELLO WORLD!') # prints to stdout | |
+ | |
+ | |
.. _with_contexts: | |
'With' contexts |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment