minio/cmd/minio/get.go
2014-12-15 21:55:54 -08:00

34 lines
569 B
Go

package main
import (
"io"
"log"
"os"
"github.com/codegangsta/cli"
)
func get(c *cli.Context) {
config, err := parseInput(c)
if err != nil {
log.Fatal(err)
}
var objectName string
var objectReader io.Reader
switch len(c.Args()) {
case 1:
objectName = c.Args().Get(0)
default:
log.Fatal("Please specify a valid object name \n # erasure-demo get [OBJECTNAME]")
}
getConfig := config
getConfig.k = 10
getConfig.m = 6
if objectReader, err = erasureGet(getConfig, objectName); err != nil {
log.Fatal(err)
}
io.Copy(os.Stdout, objectReader)
}