further modularize command options

This commit is contained in:
Anand Babu (AB) Periasamy
2015-05-30 19:39:06 -07:00
parent 21cb3f3b6d
commit 31d1c25aa7
2 changed files with 20 additions and 2 deletions
+10 -2
View File
@@ -25,8 +25,10 @@ import (
)
// Collection of mc commands currently supported are
var commands = []cli.Command{
lsCmd, // list files and objects
var commands = []cli.Command{}
/*
{
mbCmd, // make a bucket
catCmd, // concantenate an object to standard output
cpCmd, // copy objects and files from multiple sources to single destination
@@ -37,6 +39,7 @@ var commands = []cli.Command{
updateCmd, // update Check for new software updates
// Add your new commands starting from here
}
*/
// Collection of mc flags currently supported
var (
@@ -74,3 +77,8 @@ var (
// Add your new flags starting here
}
)
// registerCommand registers a cli command
func registerCommand(cmd cli.Command) {
commands = append(commands, cmd)
}
+10
View File
@@ -98,6 +98,16 @@ func getSystemData() map[string]string {
var Version = mustHashBinarySelf()
func main() {
registerCommand(lsCmd) // List contents of a bucket
registerCommand(mbCmd) // make a bucket
registerCommand(catCmd) // concantenate an object to standard output
registerCommand(cpCmd) // copy objects and files from multiple sources to single destination
registerCommand(syncCmd) // copy objects and files from single source to multiple destionations
registerCommand(diffCmd) // compare two objects
registerCommand(accessCmd) // set permissions [public, private, readonly, authenticated] for buckets and folders.
registerCommand(configCmd) // generate configuration "/home/harsha/.mc/config.json" file.
registerCommand(updateCmd) // update Check for new software updates
app := cli.NewApp()
app.Usage = "Minio Client for object storage and filesystems"
app.Version = Version