From 708b1daddc74d118c47d014a5e79804735ff6aad Mon Sep 17 00:00:00 2001 From: ExpandingMan Date: Sat, 18 Aug 2018 20:08:41 -0400 Subject: [PATCH 1/2] added documentation for read command methods --- base/process.jl | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/base/process.jl b/base/process.jl index d9b15b2e5bfe3..7e38467c3fdd4 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) + +Run a command asynchronously and return an array of bytes from the resulting stream. +""" 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, String) + +Run a command asynchronously and convert the resulting stream to a string. +""" read(cmd::AbstractCmd, ::Type{String}) = String(read(cmd)) """ From 8abac08307b0844023012cc45d599f1e868f6fb3 Mon Sep 17 00:00:00 2001 From: ExpandingMan Date: Sun, 19 Aug 2018 18:31:15 -0400 Subject: [PATCH 2/2] fixed docs --- base/process.jl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/base/process.jl b/base/process.jl index 7e38467c3fdd4..ef690c454d263 100644 --- a/base/process.jl +++ b/base/process.jl @@ -626,9 +626,9 @@ function open(f::Function, cmds::AbstractCmd, args...) end """ - read(command) + read(command::Cmd) -Run a command asynchronously and return an array of bytes from the resulting stream. +Run `command` and return the resulting output as an array of bytes. """ function read(cmd::AbstractCmd) procs = open(cmd, "r", devnull) @@ -638,9 +638,9 @@ function read(cmd::AbstractCmd) end """ - read(command, String) + read(command::Cmd, String) -Run a command asynchronously and convert the resulting stream to a string. +Run `command` and return the resulting output as a `String`. """ read(cmd::AbstractCmd, ::Type{String}) = String(read(cmd))