Discover Packages
github.com/caarlos0/cmdstream
package
module
Version:
v0.1.0
Opens a new window with list of versions in this module.
Published: Dec 27, 2019
License: MIT
Opens a new window with license information.
Imports: 4
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
README
¶
cmdstream
stream golang exec.Cmd
outputs while it is running.
I sometimes need this, and I always copy-paste from other projects, so I figured
why not leave it here as a lib.
Check godocs for usage examples.
Expand ▾
Collapse ▴
Documentation
¶
Package cmdstream provides utilities to stream long-running commands outputs
to any io.Writer while they are still running, useful on CLIs that run
other commands.
Stream streams starts the given cmd and streams its output to the given
io.Writer, waiting for the cmd to finish.
var err = Stream(exec.Command("echo", "hello"), os.Stdout)
fmt.Println(" - err:", err)
Output:
hello - err: <nil>
Source Files
¶
Click to show internal directories.
Click to hide internal directories.