minio: Server upon start displays a message if update is available.

This code also handles to turn itself off when network is not
available and if request fails. Also prints only when the update
is available.
This commit is contained in:
Harshavardhana
2016-03-24 17:20:49 -07:00
parent 24ae5467c8
commit 3538c9f598
7 changed files with 189 additions and 94 deletions
+20 -3
View File
@@ -18,13 +18,30 @@ package main
import "github.com/minio/cli"
// Collection of minio commands currently supported are
// Collection of minio commands currently supported are.
var commands = []cli.Command{}
// Collection of minio commands currently supported in a trie tree
// Collection of minio commands currently supported in a trie tree.
var commandsTree = newTrie()
// registerCommand registers a cli command
// Collection of minio flags currently supported.
var globalFlags = []cli.Flag{
cli.BoolFlag{
Name: "quiet, q",
Usage: "Suppress chatty console output.",
},
cli.BoolFlag{
Name: "debug",
Usage: "Enable debugging output.",
},
cli.StringFlag{
Name: "config-dir, C",
Value: mustGetConfigPath(),
Usage: "Path to configuration folder.",
},
}
// registerCommand registers a cli command.
func registerCommand(command cli.Command) {
commands = append(commands, command)
commandsTree.Insert(command.Name)