2014-11-30 07:48:37 +01:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
|
|
|
|
"github.com/codegangsta/cli"
|
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
app := cli.NewApp()
|
|
|
|
app.Name = "minio-encode"
|
|
|
|
app.Usage = "erasure encode a byte stream"
|
|
|
|
app.Commands = []cli.Command{
|
|
|
|
{
|
|
|
|
Name: "encode",
|
|
|
|
Usage: "erasure encode a byte stream",
|
|
|
|
Action: encode,
|
|
|
|
Flags: []cli.Flag{
|
|
|
|
cli.StringFlag{
|
|
|
|
Name: "output,o",
|
|
|
|
Value: "",
|
|
|
|
Usage: "Output file",
|
|
|
|
},
|
|
|
|
cli.StringFlag{
|
|
|
|
Name: "protection-level",
|
2014-11-30 07:59:34 +01:00
|
|
|
Value: "10,6",
|
2014-11-30 07:48:37 +01:00
|
|
|
Usage: "data,parity",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
Name: "decode",
|
|
|
|
Usage: "erasure decode a byte stream",
|
|
|
|
Action: decode,
|
|
|
|
Flags: []cli.Flag{
|
|
|
|
cli.StringFlag{
|
|
|
|
Name: "output,o",
|
|
|
|
Value: "",
|
|
|
|
Usage: "Output file",
|
|
|
|
},
|
|
|
|
cli.StringFlag{
|
|
|
|
Name: "protection-level",
|
2014-11-30 07:59:34 +01:00
|
|
|
Value: "10,6",
|
2014-11-30 07:48:37 +01:00
|
|
|
Usage: "data,parity",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
app.Run(os.Args)
|
|
|
|
}
|