From 2747c9cb71ede6a09b76a7e0dd59e8d15ebe3737 Mon Sep 17 00:00:00 2001 From: ExpandingMan Date: Mon, 20 Aug 2018 05:16:47 -0400 Subject: [PATCH] added documentation for read command methods (#28748) * added documentation for read command methods * fixed docs (cherry picked from commit f6c48ebf83983016c158f790a466b354ece7addc) --- base/process.jl | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/base/process.jl b/base/process.jl index d9b15b2e5bfe3..ef690c454d263 100644 --- a/base/process.jl +++ b/base/process.jl @@ -625,6 +625,11 @@ function open(f::Function, cmds::AbstractCmd, args...) return ret end +""" + read(command::Cmd) + +Run `command` and return the resulting output as an array of bytes. +""" function read(cmd::AbstractCmd) procs = open(cmd, "r", devnull) bytes = read(procs.out) @@ -632,6 +637,11 @@ function read(cmd::AbstractCmd) return bytes end +""" + read(command::Cmd, String) + +Run `command` and return the resulting output as a `String`. +""" read(cmd::AbstractCmd, ::Type{String}) = String(read(cmd)) """