mirror of
https://github.com/minio/minio.git
synced 2024-12-24 06:05:55 -05:00
erasure-demo put now takes 1 or 2 arguments
This commit is contained in:
parent
19da9760b3
commit
a1040ae657
@ -12,9 +12,15 @@ func put(c *cli.Context) {
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
filePath := c.Args().Get(0)
|
||||
if len(filePath) == 0 {
|
||||
log.Fatal("Please specify a valid object name \n # erasure-demo put <OBJECTNAME>")
|
||||
objectPath := c.Args().Get(0)
|
||||
var filePath string
|
||||
switch len(c.Args()) {
|
||||
case 1:
|
||||
filePath = objectPath
|
||||
case 2:
|
||||
filePath = c.Args().Get(1)
|
||||
default:
|
||||
log.Fatal("Please specify a valid object name \n # erasure-demo put [OBJECTNAME] [FILENAME]")
|
||||
}
|
||||
inputFile, err := os.Open(filePath)
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user