diff --git a/i3pystatus/core/command.py b/i3pystatus/core/command.py index 42d1bda..af79ce0 100644 --- a/i3pystatus/core/command.py +++ b/i3pystatus/core/command.py @@ -7,11 +7,21 @@ CommandResult = namedtuple("Result", ['rc', 'out', 'err']) def run_through_shell(command, enable_shell=False): """ - Retrieves output of command - Returns tuple success (boolean)/ stdout(string) / stderr (string) + Retrieve output of a command. + Returns a named tuple with three elements: - Don't use this function with programs that outputs lots of data since the output is saved - in one variable + * ``rc`` (integer) Return code of command. + * ``out`` (string) Everything that was printed to stdout. + * ``err`` (string) Everything that was printed to stderr. + + Don't use this function with programs that outputs lots of data since the + output is saved in one variable. + + :param command: A string or a list of strings containing the name and + arguments of the program. + :param enable_shell: If set ot `True` users default shell will be invoked + and given ``command`` to execute. The ``command`` should obviously be a + string since shell does all the parsing. """ if not enable_shell and not isinstance(command, list):