beam/examples/beamsh: fix a bug in the log command

Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
This commit is contained in:
Solomon Hykes 2014-03-24 18:17:16 -07:00
parent cd44538901
commit 438caf6e06

View file

@ -153,7 +153,10 @@ func parseEnv(args []string) ([]string, map[string]string) {
func CmdLog(args []string, f *os.File) { func CmdLog(args []string, f *os.File) {
defer Debugf("CmdLog done\n") defer Debugf("CmdLog done\n")
name := args[1] var name string
if len(args) > 0 {
name = args[1]
}
input := bufio.NewScanner(f) input := bufio.NewScanner(f)
for input.Scan() { for input.Scan() {
line := input.Text() line := input.Text()