From f7d2f2cf3b02fa6da9d8a1c843a179a493672f2d Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Tue, 17 Mar 2015 21:54:27 -0700 Subject: [PATCH] Add stub options and rename some functions --- cmd-cp.go | 2 +- cmd-ls.go | 2 +- cmd-mb.go | 2 +- cmd-options.go | 14 ++++++++--- donut-options.go | 63 ++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 77 insertions(+), 6 deletions(-) create mode 100644 donut-options.go diff --git a/cmd-cp.go b/cmd-cp.go index ce9c7a5b..24c5519b 100644 --- a/cmd-cp.go +++ b/cmd-cp.go @@ -247,7 +247,7 @@ func fourthMode(s3c *s3.Client, args *cmdArgs) error { return doRecursiveCp(s3c, args) } -func doFsCopy(c *cli.Context) { +func doCopy(c *cli.Context) { var args *cmdArgs var err error var s3c *s3.Client diff --git a/cmd-ls.go b/cmd-ls.go index 25256711..75d3f6af 100644 --- a/cmd-ls.go +++ b/cmd-ls.go @@ -51,7 +51,7 @@ func printObject(date time.Time, v int64, key string) { info(msg) } -func doFsList(c *cli.Context) { +func doList(c *cli.Context) { var items []*s3.Item args, err := parseArgs(c) diff --git a/cmd-mb.go b/cmd-mb.go index b455a400..6b10d388 100644 --- a/cmd-mb.go +++ b/cmd-mb.go @@ -21,7 +21,7 @@ import ( "github.com/minio-io/mc/pkg/s3" ) -func doFsMb(c *cli.Context) { +func doMakebucket(c *cli.Context) { args, err := parseArgs(c) if err != nil { fatal(err.Error()) diff --git a/cmd-options.go b/cmd-options.go index 3625b823..d527f4a6 100644 --- a/cmd-options.go +++ b/cmd-options.go @@ -24,7 +24,7 @@ var cp = cli.Command{ Name: "cp", Usage: "copy objects", Description: `Copies a local file or dir or object or bucket to another location locally or in S3.`, - Action: doFsCopy, + Action: doCopy, Flags: []cli.Flag{ cli.BoolFlag{ Name: "recursive, r", @@ -37,14 +37,14 @@ var ls = cli.Command{ Name: "ls", Usage: "get list of objects", Description: `List Objects and common prefixes under a prefix or all Buckets`, - Action: doFsList, + Action: doList, } var mb = cli.Command{ Name: "mb", Usage: "makes a bucket", Description: "Creates an S3 bucket", - Action: doFsMb, + Action: doMakebucket, } var config = cli.Command{ @@ -74,6 +74,13 @@ var config = cli.Command{ }, } +var donut = cli.Command{ + Name: "donut", + Usage: "donut admin", + Description: "", + Subcommands: donutOptions, +} + type object struct { bucket string key string @@ -91,6 +98,7 @@ var options = []cli.Command{ cp, ls, mb, + donut, config, } diff --git a/donut-options.go b/donut-options.go new file mode 100644 index 00000000..6de2615c --- /dev/null +++ b/donut-options.go @@ -0,0 +1,63 @@ +package main + +import ( + "github.com/codegangsta/cli" +) + +var format = cli.Command{ + Name: "format", + Usage: "format disk", + Description: "format a given disk", + Action: doFormat, +} + +var heal = cli.Command{ + Name: "heal", + Usage: "heal donut", + Description: "", + Action: doHeal, +} + +var attach = cli.Command{ + Name: "attach", + Usage: "attach disk", + Description: "", + Action: doAttach, +} + +var detach = cli.Command{ + Name: "detach", + Usage: "detach disk", + Description: "", + Action: doDetach, +} + +var rebalance = cli.Command{ + Name: "rebalance", + Usage: "rebalance ", + Description: "", + Action: doRebalance, +} + +var donutOptions = []cli.Command{ + format, + heal, + attach, + detach, + rebalance, +} + +func doFormat(c *cli.Context) { +} + +func doHeal(c *cli.Context) { +} + +func doAttach(c *cli.Context) { +} + +func doDetach(c *cli.Context) { +} + +func doRebalance(c *cli.Context) { +}