http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/b002dd0c/newt/Godeps/_workspace/src/github.com/spf13/cobra/README.md
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/spf13/cobra/README.md 
b/newt/Godeps/_workspace/src/github.com/spf13/cobra/README.md
deleted file mode 100644
index 750775f..0000000
--- a/newt/Godeps/_workspace/src/github.com/spf13/cobra/README.md
+++ /dev/null
@@ -1,872 +0,0 @@
-![cobra 
logo](https://cloud.githubusercontent.com/assets/173412/10886352/ad566232-814f-11e5-9cd0-aa101788c117.png)
-
-Cobra is both a library for creating powerful modern CLI applications as well 
as a program to generate applications and command files.
-
-Many of the most widely used Go projects are built using Cobra including:
-
-* [Kubernetes](http://kubernetes.io/)
-* [Hugo](http://gohugo.io)
-* [rkt](https://github.com/coreos/rkt)
-* [etcd](https://github.com/coreos/etcd)
-* [Docker (distribution)](https://github.com/docker/distribution)
-* [OpenShift](https://www.openshift.com/)
-* [Delve](https://github.com/derekparker/delve)
-* [GopherJS](http://www.gopherjs.org/)
-* [CockroachDB](http://www.cockroachlabs.com/)
-* [Bleve](http://www.blevesearch.com/)
-* [ProjectAtomic (enterprise)](http://www.projectatomic.io/)
-* [Parse (CLI)](https://parse.com/)
-* [GiantSwarm's swarm](https://github.com/giantswarm/cli)
-* 
[Nanobox](https://github.com/nanobox-io/nanobox)/[Nanopack](https://github.com/nanopack)
-
-
-[![Build Status](https://travis-ci.org/spf13/cobra.svg "Travis CI 
status")](https://travis-ci.org/spf13/cobra)
-[![CircleCI 
status](https://circleci.com/gh/spf13/cobra.png?circle-token=:circle-token 
"CircleCI status")](https://circleci.com/gh/spf13/cobra)
-
-![cobra](https://cloud.githubusercontent.com/assets/173412/10911369/84832a8e-8212-11e5-9f82-cc96660a4794.gif)
-
-# Overview
-
-Cobra is a library providing a simple interface to create powerful modern CLI
-interfaces similar to git & go tools.
-
-Cobra is also an application that will generate your application scaffolding 
to rapidly
-develop a Cobra-based application.
-
-Cobra provides:
-* Easy subcommand-based CLIs: `app server`, `app fetch`, etc.
-* Fully POSIX-compliant flags (including short & long versions)
-* Nested subcommands
-* Global, local and cascading flags
-* Easy generation of applications & commands with `cobra create appname` & 
`cobra add cmdname`
-* Intelligent suggestions (`app srver`... did you mean `app server`?)
-* Automatic help generation for commands and flags
-* Automatic detailed help for `app help [command]`
-* Automatic help flag recognition of `-h`, `--help`, etc.
-* Automatically generated bash autocomplete for your application
-* Automatically generated man pages for your application
-* Command aliases so you can change things without breaking them
-* The flexibilty to define your own help, usage, etc.
-* Optional tight integration with [viper](http://github.com/spf13/viper) for 
12-factor apps
-
-Cobra has an exceptionally clean interface and simple design without needless
-constructors or initialization methods.
-
-Applications built with Cobra commands are designed to be as user-friendly as
-possible. Flags can be placed before or after the command (as long as a
-confusing space isn’t provided). Both short and long flags can be used. A
-command need not even be fully typed.  Help is automatically generated and
-available for the application or for a specific command using either the help
-command or the `--help` flag.
-
-# Concepts
-
-Cobra is built on a structure of commands, arguments & flags.
-
-**Commands** represent actions, **Args** are things and **Flags** are 
modifiers for those actions.
-
-The best applications will read like sentences when used. Users will know how
-to use the application because they will natively understand how to use it.
-
-The pattern to follow is
-`APPNAME VERB NOUN --ADJECTIVE.`
-    or
-`APPNAME COMMAND ARG --FLAG`
-
-A few good real world examples may better illustrate this point.
-
-In the following example, 'server' is a command, and 'port' is a flag:
-
-    > hugo server --port=1313
-
-In this command we are telling Git to clone the url bare.
-
-    > git clone URL --bare
-
-## Commands
-
-Command is the central point of the application. Each interaction that
-the application supports will be contained in a Command. A command can
-have children commands and optionally run an action.
-
-In the example above, 'server' is the command.
-
-A Command has the following structure:
-
-```go
-type Command struct {
-    Use string // The one-line usage message.
-    Short string // The short description shown in the 'help' output.
-    Long string // The long message shown in the 'help <this-command>' output.
-    Run func(cmd *Command, args []string) // Run runs the command.
-}
-```
-
-## Flags
-
-A Flag is a way to modify the behavior of a command. Cobra supports
-fully POSIX-compliant flags as well as the Go [flag 
package](https://golang.org/pkg/flag/).
-A Cobra command can define flags that persist through to children commands
-and flags that are only available to that command.
-
-In the example above, 'port' is the flag.
-
-Flag functionality is provided by the [pflag
-library](https://github.com/ogier/pflag), a fork of the flag standard library
-which maintains the same interface while adding POSIX compliance.
-
-## Usage
-
-Cobra works by creating a set of commands and then organizing them into a tree.
-The tree defines the structure of the application.
-
-Once each command is defined with its corresponding flags, then the
-tree is assigned to the commander which is finally executed.
-
-# Installing
-Using Cobra is easy. First, use `go get` to install the latest version
-of the library. This command will install the `cobra` generator executible
-along with the library:
-
-    > go get -v github.com/spf13/cobra/cobra
-
-Next, include Cobra in your application:
-
-```go
-import "github.com/spf13/cobra"
-```
-
-# Getting Started
-
-While you are welcome to provide your own organization, typically a Cobra based
-application will follow the following organizational structure.
-
-```
-  ▾ appName/
-    ▾ cmd/
-        add.go
-        your.go
-        commands.go
-        here.go
-      main.go
-```
-
-In a Cobra app, typically the main.go file is very bare. It serves, one 
purpose, to initialize Cobra.
-
-```go
-package main
-
-import "{pathToYourApp}/cmd"
-
-func main() {
-       if err := cmd.RootCmd.Execute(); err != nil {
-               fmt.Println(err)
-               os.Exit(-1)
-       }
-}
-```
-
-## Using the Cobra Generator
-
-Cobra provides its own program that will create your application and add any
-commands you want. It's the easiest way to incorporate Cobra into your 
application.
-
-### cobra init
-
-The `cobra init [yourApp]` command will create your initial application code
-for you. It is a very powerful application that will populate your program with
-the right structure so you can immediately enjoy all the benefits of Cobra. It
-will also automatically apply the license you specify to your application.
-
-Cobra init is pretty smart. You can provide it a full path, or simply a path
-similar to what is expected in the import.
-
-```
-cobra init github.com/spf13/newAppName
-```
-
-### cobra add
-
-Once an application is initialized Cobra can create additional commands for 
you.
-Let's say you created an app and you wanted the following commands for it:
-
-* app serve
-* app config
-* app config create
-
-In your project directory (where your main.go file is) you would run the 
following:
-
-```
-cobra add serve
-cobra add config
-cobra add create -p 'configCmd'
-```
-
-Once you have run these three commands you would have an app structure that 
would look like:
-
-```
-  ▾ app/
-    ▾ cmd/
-        serve.go
-        config.go
-        create.go
-      main.go
-```
-
-at this point you can run `go run main.go` and it would run your app. `go run
-main.go serve`, `go run main.go config`, `go run main.go config create` along
-with `go run main.go help serve`, etc would all work.
-
-Obviously you haven't added your own code to these yet, the commands are ready
-for you to give them their tasks. Have fun.
-
-### Configuring the cobra generator
-
-The cobra generator will be easier to use if you provide a simple configuration
-file which will help you eliminate providing a bunch of repeated information in
-flags over and over.
-
-an example ~/.cobra.yaml file:
-
-```yaml
-author: Steve Francia <s...@spf13.com>
-license: MIT
-```
-
-## Manually implementing Cobra
-
-To manually implement cobra you need to create a bare main.go file and a 
RootCmd file.
-You will optionally provide additional commands as you see fit.
-
-### Create the root command
-
-The root command represents your binary itself.
-
-
-#### Manually create rootCmd
-
-Cobra doesn't require any special constructors. Simply create your commands.
-
-Ideally you place this in app/cmd/root.go:
-
-```go
-var RootCmd = &cobra.Command{
-       Use:   "hugo",
-       Short: "Hugo is a very fast static site generator",
-       Long: `A Fast and Flexible Static Site Generator built with
-                love by spf13 and friends in Go.
-                Complete documentation is available at http://hugo.spf13.com`,
-       Run: func(cmd *cobra.Command, args []string) {
-               // Do Stuff Here
-       },
-}
-```
-
-You will additionally define flags and handle configuration in your init() 
function.
-
-for example cmd/root.go:
-
-```go
-func init() {
-       cobra.OnInitialize(initConfig)
-       RootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config 
file (default is $HOME/.cobra.yaml)")
-       RootCmd.PersistentFlags().StringVarP(&projectBase, "projectbase", "b", 
"", "base project directory eg. github.com/spf13/")
-       RootCmd.PersistentFlags().StringP("author", "a", "YOUR NAME", "Author 
name for copyright attribution")
-       RootCmd.PersistentFlags().StringVarP(&userLicense, "license", "l", "", 
"Name of license for the project (can provide `licensetext` in config)")
-       RootCmd.PersistentFlags().Bool("viper", true, "Use Viper for 
configuration")
-       viper.BindPFlag("author", RootCmd.PersistentFlags().Lookup("author"))
-       viper.BindPFlag("projectbase", 
RootCmd.PersistentFlags().Lookup("projectbase"))
-       viper.BindPFlag("useViper", RootCmd.PersistentFlags().Lookup("viper"))
-       viper.SetDefault("author", "NAME HERE <EMAIL ADDRESS>")
-       viper.SetDefault("license", "apache")
-}
-```
-
-### Create your main.go
-
-With the root command you need to have your main function execute it.
-Execute should be run on the root for clarity, though it can be called on any 
command.
-
-In a Cobra app, typically the main.go file is very bare. It serves, one 
purpose, to initialize Cobra.
-
-```go
-package main
-
-import "{pathToYourApp}/cmd"
-
-func main() {
-       if err := cmd.RootCmd.Execute(); err != nil {
-               fmt.Println(err)
-               os.Exit(-1)
-       }
-}
-```
-
-
-### Create additional commands
-
-Additional commands can be defined and typically are each given their own file
-inside of the cmd/ directory.
-
-If you wanted to create a version command you would create cmd/version.go and
-populate it with the following:
-
-```go
-package cmd
-
-import (
-       "github.com/spf13/cobra"
-)
-
-func init() {
-       RootCmd.AddCommand(versionCmd)
-}
-
-var versionCmd = &cobra.Command{
-       Use:   "version",
-       Short: "Print the version number of Hugo",
-       Long:  `All software has versions. This is Hugo's`,
-       Run: func(cmd *cobra.Command, args []string) {
-               fmt.Println("Hugo Static Site Generator v0.9 -- HEAD")
-       },
-}
-```
-
-### Attach command to its parent
-
-
-If you notice in the above example we attach the command to its parent. In
-this case the parent is the rootCmd. In this example we are attaching it to the
-root, but commands can be attached at any level.
-
-```go
-RootCmd.AddCommand(versionCmd)
-```
-
-### Remove a command from its parent
-
-Removing a command is not a common action in simple programs, but it allows 3rd
-parties to customize an existing command tree.
-
-In this example, we remove the existing `VersionCmd` command of an existing
-root command, and we replace it with our own version:
-
-```go
-mainlib.RootCmd.RemoveCommand(mainlib.VersionCmd)
-mainlib.RootCmd.AddCommand(versionCmd)
-```
-
-## Working with Flags
-
-Flags provide modifiers to control how the action command operates.
-
-### Assign flags to a command
-
-Since the flags are defined and used in different locations, we need to
-define a variable outside with the correct scope to assign the flag to
-work with.
-
-```go
-var Verbose bool
-var Source string
-```
-
-There are two different approaches to assign a flag.
-
-### Persistent Flags
-
-A flag can be 'persistent' meaning that this flag will be available to the
-command it's assigned to as well as every command under that command. For
-global flags, assign a flag as a persistent flag on the root.
-
-```go
-RootCmd.PersistentFlags().BoolVarP(&Verbose, "verbose", "v", false, "verbose 
output")
-```
-
-### Local Flags
-
-A flag can also be assigned locally which will only apply to that specific 
command.
-
-```go
-RootCmd.Flags().StringVarP(&Source, "source", "s", "", "Source directory to 
read from")
-```
-
-
-## Example
-
-In the example below, we have defined three commands. Two are at the top level
-and one (cmdTimes) is a child of one of the top commands. In this case the root
-is not executable meaning that a subcommand is required. This is accomplished
-by not providing a 'Run' for the 'rootCmd'.
-
-We have only defined one flag for a single command.
-
-More documentation about flags is available at https://github.com/spf13/pflag
-
-```go
-package main
-
-import (
-       "fmt"
-       "strings"
-
-       "github.com/spf13/cobra"
-)
-
-func main() {
-
-       var echoTimes int
-
-       var cmdPrint = &cobra.Command{
-               Use:   "print [string to print]",
-               Short: "Print anything to the screen",
-               Long: `print is for printing anything back to the screen.
-            For many years people have printed back to the screen.
-            `,
-               Run: func(cmd *cobra.Command, args []string) {
-                       fmt.Println("Print: " + strings.Join(args, " "))
-               },
-       }
-
-       var cmdEcho = &cobra.Command{
-               Use:   "echo [string to echo]",
-               Short: "Echo anything to the screen",
-               Long: `echo is for echoing anything back.
-            Echo works a lot like print, except it has a child command.
-            `,
-               Run: func(cmd *cobra.Command, args []string) {
-                       fmt.Println("Print: " + strings.Join(args, " "))
-               },
-       }
-
-       var cmdTimes = &cobra.Command{
-               Use:   "times [# times] [string to echo]",
-               Short: "Echo anything to the screen more times",
-               Long: `echo things multiple times back to the user by providing
-            a count and a string.`,
-               Run: func(cmd *cobra.Command, args []string) {
-                       for i := 0; i < echoTimes; i++ {
-                               fmt.Println("Echo: " + strings.Join(args, " "))
-                       }
-               },
-       }
-
-       cmdTimes.Flags().IntVarP(&echoTimes, "times", "t", 1, "times to echo 
the input")
-
-       var rootCmd = &cobra.Command{Use: "app"}
-       rootCmd.AddCommand(cmdPrint, cmdEcho)
-       cmdEcho.AddCommand(cmdTimes)
-       rootCmd.Execute()
-}
-```
-
-For a more complete example of a larger application, please checkout 
[Hugo](http://gohugo.io/).
-
-## The Help Command
-
-Cobra automatically adds a help command to your application when you have 
subcommands.
-This will be called when a user runs 'app help'. Additionally, help will also
-support all other commands as input. Say, for instance, you have a command 
called
-'create' without any additional configuration; Cobra will work when 'app help
-create' is called.  Every command will automatically have the '--help' flag 
added.
-
-### Example
-
-The following output is automatically generated by Cobra. Nothing beyond the
-command and flag definitions are needed.
-
-    > hugo help
-
-    hugo is the main command, used to build your Hugo site.
-
-    Hugo is a Fast and Flexible Static Site Generator
-    built with love by spf13 and friends in Go.
-
-    Complete documentation is available at http://gohugo.io/.
-
-    Usage:
-      hugo [flags]
-      hugo [command]
-
-    Available Commands:
-      server          Hugo runs its own webserver to render the files
-      version         Print the version number of Hugo
-      config          Print the site configuration
-      check           Check content in the source directory
-      benchmark       Benchmark hugo by building a site a number of times.
-      convert         Convert your content to different formats
-      new             Create new content for your site
-      list            Listing out various types of content
-      undraft         Undraft changes the content's draft status from 'True' 
to 'False'
-      genautocomplete Generate shell autocompletion script for Hugo
-      gendoc          Generate Markdown documentation for the Hugo CLI.
-      genman          Generate man page for Hugo
-      import          Import your site from others.
-
-    Flags:
-      -b, --baseURL="": hostname (and path) to the root, e.g. http://spf13.com/
-      -D, --buildDrafts[=false]: include content marked as draft
-      -F, --buildFuture[=false]: include content with publishdate in the future
-          --cacheDir="": filesystem path to cache directory. Defaults: 
$TMPDIR/hugo_cache/
-          --canonifyURLs[=false]: if true, all relative URLs will be 
canonicalized using baseURL
-          --config="": config file (default is path/config.yaml|json|toml)
-      -d, --destination="": filesystem path to write files to
-          --disableRSS[=false]: Do not build RSS files
-          --disableSitemap[=false]: Do not build Sitemap file
-          --editor="": edit new content with this editor, if provided
-          --ignoreCache[=false]: Ignores the cache directory for reading but 
still writes to it
-          --log[=false]: Enable Logging
-          --logFile="": Log File path (if set, logging enabled automatically)
-          --noTimes[=false]: Don't sync modification time of files
-          --pluralizeListTitles[=true]: Pluralize titles in lists using inflect
-          --preserveTaxonomyNames[=false]: Preserve taxonomy names as written 
("Gérard Depardieu" vs "gerard-depardieu")
-      -s, --source="": filesystem path to read files relative from
-          --stepAnalysis[=false]: display memory and timing of different steps 
of the program
-      -t, --theme="": theme to use (located in /themes/THEMENAME/)
-          --uglyURLs[=false]: if true, use /filename.html instead of /filename/
-      -v, --verbose[=false]: verbose output
-          --verboseLog[=false]: verbose logging
-      -w, --watch[=false]: watch filesystem for changes and recreate as needed
-
-    Use "hugo [command] --help" for more information about a command.
-
-
-Help is just a command like any other. There is no special logic or behavior
-around it. In fact, you can provide your own if you want.
-
-### Defining your own help
-
-You can provide your own Help command or your own template for the default 
command to use.
-
-The default help command is
-
-```go
-func (c *Command) initHelp() {
-       if c.helpCommand == nil {
-               c.helpCommand = &Command{
-                       Use:   "help [command]",
-                       Short: "Help about any command",
-                       Long: `Help provides help for any command in the 
application.
-        Simply type ` + c.Name() + ` help [path to command] for full details.`,
-                       Run: c.HelpFunc(),
-               }
-       }
-       c.AddCommand(c.helpCommand)
-}
-```
-
-You can provide your own command, function or template through the following 
methods:
-
-```go
-command.SetHelpCommand(cmd *Command)
-
-command.SetHelpFunc(f func(*Command, []string))
-
-command.SetHelpTemplate(s string)
-```
-
-The latter two will also apply to any children commands.
-
-## Usage
-
-When the user provides an invalid flag or invalid command, Cobra responds by
-showing the user the 'usage'.
-
-### Example
-You may recognize this from the help above. That's because the default help
-embeds the usage as part of its output.
-
-    Usage:
-      hugo [flags]
-      hugo [command]
-
-    Available Commands:
-      server          Hugo runs its own webserver to render the files
-      version         Print the version number of Hugo
-      config          Print the site configuration
-      check           Check content in the source directory
-      benchmark       Benchmark hugo by building a site a number of times.
-      convert         Convert your content to different formats
-      new             Create new content for your site
-      list            Listing out various types of content
-      undraft         Undraft changes the content's draft status from 'True' 
to 'False'
-      genautocomplete Generate shell autocompletion script for Hugo
-      gendoc          Generate Markdown documentation for the Hugo CLI.
-      genman          Generate man page for Hugo
-      import          Import your site from others.
-
-    Flags:
-      -b, --baseURL="": hostname (and path) to the root, e.g. http://spf13.com/
-      -D, --buildDrafts[=false]: include content marked as draft
-      -F, --buildFuture[=false]: include content with publishdate in the future
-          --cacheDir="": filesystem path to cache directory. Defaults: 
$TMPDIR/hugo_cache/
-          --canonifyURLs[=false]: if true, all relative URLs will be 
canonicalized using baseURL
-          --config="": config file (default is path/config.yaml|json|toml)
-      -d, --destination="": filesystem path to write files to
-          --disableRSS[=false]: Do not build RSS files
-          --disableSitemap[=false]: Do not build Sitemap file
-          --editor="": edit new content with this editor, if provided
-          --ignoreCache[=false]: Ignores the cache directory for reading but 
still writes to it
-          --log[=false]: Enable Logging
-          --logFile="": Log File path (if set, logging enabled automatically)
-          --noTimes[=false]: Don't sync modification time of files
-          --pluralizeListTitles[=true]: Pluralize titles in lists using inflect
-          --preserveTaxonomyNames[=false]: Preserve taxonomy names as written 
("Gérard Depardieu" vs "gerard-depardieu")
-      -s, --source="": filesystem path to read files relative from
-          --stepAnalysis[=false]: display memory and timing of different steps 
of the program
-      -t, --theme="": theme to use (located in /themes/THEMENAME/)
-          --uglyURLs[=false]: if true, use /filename.html instead of /filename/
-      -v, --verbose[=false]: verbose output
-          --verboseLog[=false]: verbose logging
-      -w, --watch[=false]: watch filesystem for changes and recreate as needed
-
-### Defining your own usage
-You can provide your own usage function or template for Cobra to use.
-
-The default usage function is:
-
-```go
-return func(c *Command) error {
-       err := tmpl(c.Out(), c.UsageTemplate(), c)
-       return err
-}
-```
-
-Like help, the function and template are overridable through public methods:
-
-```go
-command.SetUsageFunc(f func(*Command) error)
-
-command.SetUsageTemplate(s string)
-```
-
-## PreRun or PostRun Hooks
-
-It is possible to run functions before or after the main `Run` function of 
your command. The `PersistentPreRun` and `PreRun` functions will be executed 
before `Run`. `PersistentPostRun` and `PostRun` will be executed after `Run`.  
The `Persistent*Run` functions will be inherrited by children if they do not 
declare their own.  These function are run in the following order:
-
-- `PersistentPreRun`
-- `PreRun`
-- `Run`
-- `PostRun`
-- `PersistentPostRun`
-
-An example of two commands which use all of these features is below.  When the 
subcommand is executed, it will run the root command's `PersistentPreRun` but 
not the root command's `PersistentPostRun`:
-
-```go
-package main
-
-import (
-       "fmt"
-
-       "github.com/spf13/cobra"
-)
-
-func main() {
-
-       var rootCmd = &cobra.Command{
-               Use:   "root [sub]",
-               Short: "My root command",
-               PersistentPreRun: func(cmd *cobra.Command, args []string) {
-                       fmt.Printf("Inside rootCmd PersistentPreRun with args: 
%v\n", args)
-               },
-               PreRun: func(cmd *cobra.Command, args []string) {
-                       fmt.Printf("Inside rootCmd PreRun with args: %v\n", 
args)
-               },
-               Run: func(cmd *cobra.Command, args []string) {
-                       fmt.Printf("Inside rootCmd Run with args: %v\n", args)
-               },
-               PostRun: func(cmd *cobra.Command, args []string) {
-                       fmt.Printf("Inside rootCmd PostRun with args: %v\n", 
args)
-               },
-               PersistentPostRun: func(cmd *cobra.Command, args []string) {
-                       fmt.Printf("Inside rootCmd PersistentPostRun with args: 
%v\n", args)
-               },
-       }
-
-       var subCmd = &cobra.Command{
-               Use:   "sub [no options!]",
-               Short: "My subcommand",
-               PreRun: func(cmd *cobra.Command, args []string) {
-                       fmt.Printf("Inside subCmd PreRun with args: %v\n", args)
-               },
-               Run: func(cmd *cobra.Command, args []string) {
-                       fmt.Printf("Inside subCmd Run with args: %v\n", args)
-               },
-               PostRun: func(cmd *cobra.Command, args []string) {
-                       fmt.Printf("Inside subCmd PostRun with args: %v\n", 
args)
-               },
-               PersistentPostRun: func(cmd *cobra.Command, args []string) {
-                       fmt.Printf("Inside subCmd PersistentPostRun with args: 
%v\n", args)
-               },
-       }
-
-       rootCmd.AddCommand(subCmd)
-
-       rootCmd.SetArgs([]string{""})
-       _ = rootCmd.Execute()
-       fmt.Print("\n")
-       rootCmd.SetArgs([]string{"sub", "arg1", "arg2"})
-       _ = rootCmd.Execute()
-}
-```
-
-
-## Alternative Error Handling
-
-Cobra also has functions where the return signature is an error. This allows 
for errors to bubble up to the top, providing a way to handle the errors in one 
location. The current list of functions that return an error is:
-
-* PersistentPreRunE
-* PreRunE
-* RunE
-* PostRunE
-* PersistentPostRunE
-
-**Example Usage using RunE:**
-
-```go
-package main
-
-import (
-       "errors"
-       "log"
-
-       "github.com/spf13/cobra"
-)
-
-func main() {
-       var rootCmd = &cobra.Command{
-               Use:   "hugo",
-               Short: "Hugo is a very fast static site generator",
-               Long: `A Fast and Flexible Static Site Generator built with
-                love by spf13 and friends in Go.
-                Complete documentation is available at http://hugo.spf13.com`,
-               RunE: func(cmd *cobra.Command, args []string) error {
-                       // Do Stuff Here
-                       return errors.New("some random error")
-               },
-       }
-
-       if err := rootCmd.Execute(); err != nil {
-               log.Fatal(err)
-       }
-}
-```
-
-## Suggestions when "unknown command" happens
-
-Cobra will print automatic suggestions when "unknown command" errors happen. 
This allows Cobra to behave similarly to the `git` command when a typo happens. 
For example:
-
-```
-$ hugo srever
-Error: unknown command "srever" for "hugo"
-
-Did you mean this?
-        server
-
-Run 'hugo --help' for usage.
-```
-
-Suggestions are automatic based on every subcommand registered and use an 
implementation of [Levenshtein 
distance](http://en.wikipedia.org/wiki/Levenshtein_distance). Every registered 
command that matches a minimum distance of 2 (ignoring case) will be displayed 
as a suggestion.
-
-If you need to disable suggestions or tweak the string distance in your 
command, use:
-
-```go
-command.DisableSuggestions = true
-```
-
-or
-
-```go
-command.SuggestionsMinimumDistance = 1
-```
-
-You can also explicitly set names for which a given command will be suggested 
using the `SuggestFor` attribute. This allows suggestions for strings that are 
not close in terms of string distance, but makes sense in your set of commands 
and for some which you don't want aliases. Example:
-
-```
-$ kubectl remove
-Error: unknown command "remove" for "kubectl"
-
-Did you mean this?
-        delete
-
-Run 'kubectl help' for usage.
-```
-
-## Generating Markdown-formatted documentation for your command
-
-Cobra can generate a Markdown-formatted document based on the subcommands, 
flags, etc. A simple example of how to do this for your command can be found in 
[Markdown Docs](doc/md_docs.md).
-
-## Generating man pages for your command
-
-Cobra can generate a man page based on the subcommands, flags, etc. A simple 
example of how to do this for your command can be found in [Man 
Docs](doc/man_docs.md).
-
-## Generating bash completions for your command
-
-Cobra can generate a bash-completion file. If you add more information to your 
command, these completions can be amazingly powerful and flexible.  Read more 
about it in [Bash Completions](bash_completions.md).
-
-## Debugging
-
-Cobra provides a ‘DebugFlags’ method on a command which, when called, will 
print
-out everything Cobra knows about the flags for each command.
-
-### Example
-
-```go
-command.DebugFlags()
-```
-
-## Release Notes
-* **0.9.0** June 17, 2014
-  * flags can appears anywhere in the args (provided they are unambiguous)
-  * --help prints usage screen for app or command
-  * Prefix matching for commands
-  * Cleaner looking help and usage output
-  * Extensive test suite
-* **0.8.0** Nov 5, 2013
-  * Reworked interface to remove commander completely
-  * Command now primary structure
-  * No initialization needed
-  * Usage & Help templates & functions definable at any level
-  * Updated Readme
-* **0.7.0** Sept 24, 2013
-  * Needs more eyes
-  * Test suite
-  * Support for automatic error messages
-  * Support for help command
-  * Support for printing to any io.Writer instead of os.Stderr
-  * Support for persistent flags which cascade down tree
-  * Ready for integration into Hugo
-* **0.1.0** Sept 3, 2013
-  * Implement first draft
-
-## Extensions
-
-Libraries for extending Cobra:
-
-* [cmdns](https://github.com/gosuri/cmdns): Enables name spacing a command's 
immediate children. It provides an alternative way to structure subcommands, 
similar to `heroku apps:create` and `ovrclk clusters:launch`.
-
-## ToDo
-* Launch proper documentation site
-
-## Contributing
-
-1. Fork it
-2. Create your feature branch (`git checkout -b my-new-feature`)
-3. Commit your changes (`git commit -am 'Add some feature'`)
-4. Push to the branch (`git push origin my-new-feature`)
-5. Create new Pull Request
-
-## Contributors
-
-Names in no particular order:
-
-* [spf13](https://github.com/spf13),
-[eparis](https://github.com/eparis),
-[bep](https://github.com/bep), and many more!
-
-## License
-
-Cobra is released under the Apache 2.0 license. See 
[LICENSE.txt](https://github.com/spf13/cobra/blob/master/LICENSE.txt)
-
-
-[![Bitdeli 
Badge](https://d2weczhvl823v0.cloudfront.net/spf13/cobra/trend.png)](https://bitdeli.com/free
 "Bitdeli Badge")

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/b002dd0c/newt/Godeps/_workspace/src/github.com/spf13/cobra/bash_completions.go
----------------------------------------------------------------------
diff --git 
a/newt/Godeps/_workspace/src/github.com/spf13/cobra/bash_completions.go 
b/newt/Godeps/_workspace/src/github.com/spf13/cobra/bash_completions.go
deleted file mode 100644
index eea11ee..0000000
--- a/newt/Godeps/_workspace/src/github.com/spf13/cobra/bash_completions.go
+++ /dev/null
@@ -1,532 +0,0 @@
-package cobra
-
-import (
-       "fmt"
-       "io"
-       "os"
-       "sort"
-       "strings"
-
-       "github.com/spf13/pflag"
-)
-
-const (
-       BashCompFilenameExt     = 
"cobra_annotation_bash_completion_filename_extentions"
-       BashCompOneRequiredFlag = 
"cobra_annotation_bash_completion_one_required_flag"
-       BashCompSubdirsInDir    = 
"cobra_annotation_bash_completion_subdirs_in_dir"
-)
-
-func preamble(out io.Writer, name string) error {
-       _, err := fmt.Fprintf(out, "# bash completion for %-36s -*- 
shell-script -*-\n", name)
-       if err != nil {
-               return err
-       }
-       _, err = fmt.Fprintf(out, `
-__debug()
-{
-    if [[ -n ${BASH_COMP_DEBUG_FILE} ]]; then
-        echo "$*" >> "${BASH_COMP_DEBUG_FILE}"
-    fi
-}
-
-# Homebrew on Macs have version 1.3 of bash-completion which doesn't include
-# _init_completion. This is a very minimal version of that function.
-__my_init_completion()
-{
-    COMPREPLY=()
-    _get_comp_words_by_ref cur prev words cword
-}
-
-__index_of_word()
-{
-    local w word=$1
-    shift
-    index=0
-    for w in "$@"; do
-        [[ $w = "$word" ]] && return
-        index=$((index+1))
-    done
-    index=-1
-}
-
-__contains_word()
-{
-    local w word=$1; shift
-    for w in "$@"; do
-        [[ $w = "$word" ]] && return
-    done
-    return 1
-}
-
-__handle_reply()
-{
-    __debug "${FUNCNAME}"
-    case $cur in
-        -*)
-            if [[ $(type -t compopt) = "builtin" ]]; then
-                compopt -o nospace
-            fi
-            local allflags
-            if [ ${#must_have_one_flag[@]} -ne 0 ]; then
-                allflags=("${must_have_one_flag[@]}")
-            else
-                allflags=("${flags[*]} ${two_word_flags[*]}")
-            fi
-            COMPREPLY=( $(compgen -W "${allflags[*]}" -- "$cur") )
-            if [[ $(type -t compopt) = "builtin" ]]; then
-                [[ $COMPREPLY == *= ]] || compopt +o nospace
-            fi
-            return 0;
-            ;;
-    esac
-
-    # check if we are handling a flag with special work handling
-    local index
-    __index_of_word "${prev}" "${flags_with_completion[@]}"
-    if [[ ${index} -ge 0 ]]; then
-        ${flags_completion[${index}]}
-        return
-    fi
-
-    # we are parsing a flag and don't have a special handler, no completion
-    if [[ ${cur} != "${words[cword]}" ]]; then
-        return
-    fi
-
-    local completions
-    if [[ ${#must_have_one_flag[@]} -ne 0 ]]; then
-        completions=("${must_have_one_flag[@]}")
-    elif [[ ${#must_have_one_noun[@]} -ne 0 ]]; then
-        completions=("${must_have_one_noun[@]}")
-    else
-        completions=("${commands[@]}")
-    fi
-    COMPREPLY=( $(compgen -W "${completions[*]}" -- "$cur") )
-
-    if [[ ${#COMPREPLY[@]} -eq 0 ]]; then
-        declare -F __custom_func >/dev/null && __custom_func
-    fi
-
-    __ltrim_colon_completions "$cur"
-}
-
-# The arguments should be in the form "ext1|ext2|extn"
-__handle_filename_extension_flag()
-{
-    local ext="$1"
-    _filedir "@(${ext})"
-}
-
-__handle_subdirs_in_dir_flag()
-{
-    local dir="$1"
-    pushd "${dir}" >/dev/null 2>&1 && _filedir -d && popd >/dev/null 2>&1
-}
-
-__handle_flag()
-{
-    __debug "${FUNCNAME}: c is $c words[c] is ${words[c]}"
-
-    # if a command required a flag, and we found it, unset must_have_one_flag()
-    local flagname=${words[c]}
-    local flagvalue
-    # if the word contained an =
-    if [[ ${words[c]} == *"="* ]]; then
-        flagvalue=${flagname#*=} # take in as flagvalue after the =
-        flagname=${flagname%%=*} # strip everything after the =
-        flagname="${flagname}=" # but put the = back
-    fi
-    __debug "${FUNCNAME}: looking for ${flagname}"
-    if __contains_word "${flagname}" "${must_have_one_flag[@]}"; then
-        must_have_one_flag=()
-    fi
-
-    # keep flag value with flagname as flaghash
-    if [ ${flagvalue} ] ; then
-        flaghash[${flagname}]=${flagvalue}
-    elif [ ${words[ $((c+1)) ]} ] ; then
-        flaghash[${flagname}]=${words[ $((c+1)) ]}
-    else
-        flaghash[${flagname}]="true" # pad "true" for bool flag
-    fi
-
-    # skip the argument to a two word flag
-    if __contains_word "${words[c]}" "${two_word_flags[@]}"; then
-        c=$((c+1))
-        # if we are looking for a flags value, don't show commands
-        if [[ $c -eq $cword ]]; then
-            commands=()
-        fi
-    fi
-
-    c=$((c+1))
-
-}
-
-__handle_noun()
-{
-    __debug "${FUNCNAME}: c is $c words[c] is ${words[c]}"
-
-    if __contains_word "${words[c]}" "${must_have_one_noun[@]}"; then
-        must_have_one_noun=()
-    fi
-
-    nouns+=("${words[c]}")
-    c=$((c+1))
-}
-
-__handle_command()
-{
-    __debug "${FUNCNAME}: c is $c words[c] is ${words[c]}"
-
-    local next_command
-    if [[ -n ${last_command} ]]; then
-        next_command="_${last_command}_${words[c]//:/__}"
-    else
-        if [[ $c -eq 0 ]]; then
-            next_command="_$(basename ${words[c]//:/__})"
-        else
-            next_command="_${words[c]//:/__}"
-        fi
-    fi
-    c=$((c+1))
-    __debug "${FUNCNAME}: looking for ${next_command}"
-    declare -F $next_command >/dev/null && $next_command
-}
-
-__handle_word()
-{
-    if [[ $c -ge $cword ]]; then
-        __handle_reply
-        return
-    fi
-    __debug "${FUNCNAME}: c is $c words[c] is ${words[c]}"
-    if [[ "${words[c]}" == -* ]]; then
-        __handle_flag
-    elif __contains_word "${words[c]}" "${commands[@]}"; then
-        __handle_command
-    elif [[ $c -eq 0 ]] && __contains_word "$(basename ${words[c]})" 
"${commands[@]}"; then
-        __handle_command
-    else
-        __handle_noun
-    fi
-    __handle_word
-}
-
-`)
-       return err
-}
-
-func postscript(w io.Writer, name string) error {
-       name = strings.Replace(name, ":", "__", -1)
-       _, err := fmt.Fprintf(w, "__start_%s()\n", name)
-       if err != nil {
-               return err
-       }
-       _, err = fmt.Fprintf(w, `{
-    local cur prev words cword
-    declare -A flaghash 2>/dev/null || :
-    if declare -F _init_completion >/dev/null 2>&1; then
-        _init_completion -s || return
-    else
-        __my_init_completion || return
-    fi
-
-    local c=0
-    local flags=()
-    local two_word_flags=()
-    local flags_with_completion=()
-    local flags_completion=()
-    local commands=("%s")
-    local must_have_one_flag=()
-    local must_have_one_noun=()
-    local last_command
-    local nouns=()
-
-    __handle_word
-}
-
-`, name)
-       if err != nil {
-               return err
-       }
-       _, err = fmt.Fprintf(w, `if [[ $(type -t compopt) = "builtin" ]]; then
-    complete -o default -F __start_%s %s
-else
-    complete -o default -o nospace -F __start_%s %s
-fi
-
-`, name, name, name, name)
-       if err != nil {
-               return err
-       }
-       _, err = fmt.Fprintf(w, "# ex: ts=4 sw=4 et filetype=sh\n")
-       return err
-}
-
-func writeCommands(cmd *Command, w io.Writer) error {
-       if _, err := fmt.Fprintf(w, "    commands=()\n"); err != nil {
-               return err
-       }
-       for _, c := range cmd.Commands() {
-               if !c.IsAvailableCommand() || c == cmd.helpCommand {
-                       continue
-               }
-               if _, err := fmt.Fprintf(w, "    commands+=(%q)\n", c.Name()); 
err != nil {
-                       return err
-               }
-       }
-       _, err := fmt.Fprintf(w, "\n")
-       return err
-}
-
-func writeFlagHandler(name string, annotations map[string][]string, w 
io.Writer) error {
-       for key, value := range annotations {
-               switch key {
-               case BashCompFilenameExt:
-                       _, err := fmt.Fprintf(w, "    
flags_with_completion+=(%q)\n", name)
-                       if err != nil {
-                               return err
-                       }
-
-                       if len(value) > 0 {
-                               ext := "__handle_filename_extension_flag " + 
strings.Join(value, "|")
-                               _, err = fmt.Fprintf(w, "    
flags_completion+=(%q)\n", ext)
-                       } else {
-                               ext := "_filedir"
-                               _, err = fmt.Fprintf(w, "    
flags_completion+=(%q)\n", ext)
-                       }
-                       if err != nil {
-                               return err
-                       }
-               case BashCompSubdirsInDir:
-                       _, err := fmt.Fprintf(w, "    
flags_with_completion+=(%q)\n", name)
-
-                       if len(value) == 1 {
-                               ext := "__handle_subdirs_in_dir_flag " + 
value[0]
-                               _, err = fmt.Fprintf(w, "    
flags_completion+=(%q)\n", ext)
-                       } else {
-                               ext := "_filedir -d"
-                               _, err = fmt.Fprintf(w, "    
flags_completion+=(%q)\n", ext)
-                       }
-                       if err != nil {
-                               return err
-                       }
-               }
-       }
-       return nil
-}
-
-func writeShortFlag(flag *pflag.Flag, w io.Writer) error {
-       b := (flag.Value.Type() == "bool")
-       name := flag.Shorthand
-       format := "    "
-       if !b {
-               format += "two_word_"
-       }
-       format += "flags+=(\"-%s\")\n"
-       if _, err := fmt.Fprintf(w, format, name); err != nil {
-               return err
-       }
-       return writeFlagHandler("-"+name, flag.Annotations, w)
-}
-
-func writeFlag(flag *pflag.Flag, w io.Writer) error {
-       b := (flag.Value.Type() == "bool")
-       name := flag.Name
-       format := "    flags+=(\"--%s"
-       if !b {
-               format += "="
-       }
-       format += "\")\n"
-       if _, err := fmt.Fprintf(w, format, name); err != nil {
-               return err
-       }
-       return writeFlagHandler("--"+name, flag.Annotations, w)
-}
-
-func writeFlags(cmd *Command, w io.Writer) error {
-       _, err := fmt.Fprintf(w, `    flags=()
-    two_word_flags=()
-    flags_with_completion=()
-    flags_completion=()
-
-`)
-       if err != nil {
-               return err
-       }
-       var visitErr error
-       cmd.NonInheritedFlags().VisitAll(func(flag *pflag.Flag) {
-               if err := writeFlag(flag, w); err != nil {
-                       visitErr = err
-                       return
-               }
-               if len(flag.Shorthand) > 0 {
-                       if err := writeShortFlag(flag, w); err != nil {
-                               visitErr = err
-                               return
-                       }
-               }
-       })
-       if visitErr != nil {
-               return visitErr
-       }
-       cmd.InheritedFlags().VisitAll(func(flag *pflag.Flag) {
-               if err := writeFlag(flag, w); err != nil {
-                       visitErr = err
-                       return
-               }
-               if len(flag.Shorthand) > 0 {
-                       if err := writeShortFlag(flag, w); err != nil {
-                               visitErr = err
-                               return
-                       }
-               }
-       })
-       if visitErr != nil {
-               return visitErr
-       }
-
-       _, err = fmt.Fprintf(w, "\n")
-       return err
-}
-
-func writeRequiredFlag(cmd *Command, w io.Writer) error {
-       if _, err := fmt.Fprintf(w, "    must_have_one_flag=()\n"); err != nil {
-               return err
-       }
-       flags := cmd.NonInheritedFlags()
-       var visitErr error
-       flags.VisitAll(func(flag *pflag.Flag) {
-               for key := range flag.Annotations {
-                       switch key {
-                       case BashCompOneRequiredFlag:
-                               format := "    must_have_one_flag+=(\"--%s"
-                               b := (flag.Value.Type() == "bool")
-                               if !b {
-                                       format += "="
-                               }
-                               format += "\")\n"
-                               if _, err := fmt.Fprintf(w, format, flag.Name); 
err != nil {
-                                       visitErr = err
-                                       return
-                               }
-
-                               if len(flag.Shorthand) > 0 {
-                                       if _, err := fmt.Fprintf(w, "    
must_have_one_flag+=(\"-%s\")\n", flag.Shorthand); err != nil {
-                                               visitErr = err
-                                               return
-                                       }
-                               }
-                       }
-               }
-       })
-       return visitErr
-}
-
-func writeRequiredNoun(cmd *Command, w io.Writer) error {
-       if _, err := fmt.Fprintf(w, "    must_have_one_noun=()\n"); err != nil {
-               return err
-       }
-       sort.Sort(sort.StringSlice(cmd.ValidArgs))
-       for _, value := range cmd.ValidArgs {
-               if _, err := fmt.Fprintf(w, "    must_have_one_noun+=(%q)\n", 
value); err != nil {
-                       return err
-               }
-       }
-       return nil
-}
-
-func gen(cmd *Command, w io.Writer) error {
-       for _, c := range cmd.Commands() {
-               if !c.IsAvailableCommand() || c == cmd.helpCommand {
-                       continue
-               }
-               if err := gen(c, w); err != nil {
-                       return err
-               }
-       }
-       commandName := cmd.CommandPath()
-       commandName = strings.Replace(commandName, " ", "_", -1)
-       commandName = strings.Replace(commandName, ":", "__", -1)
-       if _, err := fmt.Fprintf(w, "_%s()\n{\n", commandName); err != nil {
-               return err
-       }
-       if _, err := fmt.Fprintf(w, "    last_command=%q\n", commandName); err 
!= nil {
-               return err
-       }
-       if err := writeCommands(cmd, w); err != nil {
-               return err
-       }
-       if err := writeFlags(cmd, w); err != nil {
-               return err
-       }
-       if err := writeRequiredFlag(cmd, w); err != nil {
-               return err
-       }
-       if err := writeRequiredNoun(cmd, w); err != nil {
-               return err
-       }
-       if _, err := fmt.Fprintf(w, "}\n\n"); err != nil {
-               return err
-       }
-       return nil
-}
-
-func (cmd *Command) GenBashCompletion(w io.Writer) error {
-       if err := preamble(w, cmd.Name()); err != nil {
-               return err
-       }
-       if len(cmd.BashCompletionFunction) > 0 {
-               if _, err := fmt.Fprintf(w, "%s\n", 
cmd.BashCompletionFunction); err != nil {
-                       return err
-               }
-       }
-       if err := gen(cmd, w); err != nil {
-               return err
-       }
-       return postscript(w, cmd.Name())
-}
-
-func (cmd *Command) GenBashCompletionFile(filename string) error {
-       outFile, err := os.Create(filename)
-       if err != nil {
-               return err
-       }
-       defer outFile.Close()
-
-       return cmd.GenBashCompletion(outFile)
-}
-
-// MarkFlagRequired adds the BashCompOneRequiredFlag annotation to the named 
flag, if it exists.
-func (cmd *Command) MarkFlagRequired(name string) error {
-       return MarkFlagRequired(cmd.Flags(), name)
-}
-
-// MarkPersistentFlagRequired adds the BashCompOneRequiredFlag annotation to 
the named persistent flag, if it exists.
-func (cmd *Command) MarkPersistentFlagRequired(name string) error {
-       return MarkFlagRequired(cmd.PersistentFlags(), name)
-}
-
-// MarkFlagRequired adds the BashCompOneRequiredFlag annotation to the named 
flag in the flag set, if it exists.
-func MarkFlagRequired(flags *pflag.FlagSet, name string) error {
-       return flags.SetAnnotation(name, BashCompOneRequiredFlag, 
[]string{"true"})
-}
-
-// MarkFlagFilename adds the BashCompFilenameExt annotation to the named flag, 
if it exists.
-// Generated bash autocompletion will select filenames for the flag, limiting 
to named extensions if provided.
-func (cmd *Command) MarkFlagFilename(name string, extensions ...string) error {
-       return MarkFlagFilename(cmd.Flags(), name, extensions...)
-}
-
-// MarkPersistentFlagFilename adds the BashCompFilenameExt annotation to the 
named persistent flag, if it exists.
-// Generated bash autocompletion will select filenames for the flag, limiting 
to named extensions if provided.
-func (cmd *Command) MarkPersistentFlagFilename(name string, extensions 
...string) error {
-       return MarkFlagFilename(cmd.PersistentFlags(), name, extensions...)
-}
-
-// MarkFlagFilename adds the BashCompFilenameExt annotation to the named flag 
in the flag set, if it exists.
-// Generated bash autocompletion will select filenames for the flag, limiting 
to named extensions if provided.
-func MarkFlagFilename(flags *pflag.FlagSet, name string, extensions ...string) 
error {
-       return flags.SetAnnotation(name, BashCompFilenameExt, extensions)
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/b002dd0c/newt/Godeps/_workspace/src/github.com/spf13/cobra/bash_completions.md
----------------------------------------------------------------------
diff --git 
a/newt/Godeps/_workspace/src/github.com/spf13/cobra/bash_completions.md 
b/newt/Godeps/_workspace/src/github.com/spf13/cobra/bash_completions.md
deleted file mode 100644
index 204704e..0000000
--- a/newt/Godeps/_workspace/src/github.com/spf13/cobra/bash_completions.md
+++ /dev/null
@@ -1,149 +0,0 @@
-# Generating Bash Completions For Your Own cobra.Command
-
-Generating bash completions from a cobra command is incredibly easy. An actual 
program which does so for the kubernetes kubectl binary is as follows:
-
-```go
-package main
-
-import (
-        "io/ioutil"
-        "os"
-
-        "github.com/GoogleCloudPlatform/kubernetes/pkg/kubectl/cmd"
-)
-
-func main() {
-        kubectl := cmd.NewFactory(nil).NewKubectlCommand(os.Stdin, 
ioutil.Discard, ioutil.Discard)
-        kubectl.GenBashCompletionFile("out.sh")
-}
-```
-
-That will get you completions of subcommands and flags. If you make additional 
annotations to your code, you can get even more intelligent and flexible 
behavior.
-
-## Creating your own custom functions
-
-Some more actual code that works in kubernetes:
-
-```bash
-const (
-        bash_completion_func = `__kubectl_parse_get()
-{
-    local kubectl_output out
-    if kubectl_output=$(kubectl get --no-headers "$1" 2>/dev/null); then
-        out=($(echo "${kubectl_output}" | awk '{print $1}'))
-        COMPREPLY=( $( compgen -W "${out[*]}" -- "$cur" ) )
-    fi
-}
-
-__kubectl_get_resource()
-{
-    if [[ ${#nouns[@]} -eq 0 ]]; then
-        return 1
-    fi
-    __kubectl_parse_get ${nouns[${#nouns[@]} -1]}
-    if [[ $? -eq 0 ]]; then
-        return 0
-    fi
-}
-
-__custom_func() {
-    case ${last_command} in
-        kubectl_get | kubectl_describe | kubectl_delete | kubectl_stop)
-            __kubectl_get_resource
-            return
-            ;;
-        *)
-            ;;
-    esac
-}
-`)
-```
-
-And then I set that in my command definition:
-
-```go
-cmds := &cobra.Command{
-       Use:   "kubectl",
-       Short: "kubectl controls the Kubernetes cluster manager",
-       Long: `kubectl controls the Kubernetes cluster manager.
-
-Find more information at https://github.com/GoogleCloudPlatform/kubernetes.`,
-       Run: runHelp,
-       BashCompletionFunction: bash_completion_func,
-}
-```
-
-The `BashCompletionFunction` option is really only valid/useful on the root 
command. Doing the above will cause `__custom_func()` to be called when the 
built in processor was unable to find a solution. In the case of kubernetes a 
valid command might look something like `kubectl get pod [mypod]`. If you type 
`kubectl get pod [tab][tab]` the `__customc_func()` will run because the 
cobra.Command only understood "kubectl" and "get." `__custom_func()` will see 
that the cobra.Command is "kubectl_get" and will thus call another helper 
`__kubectl_get_resource()`.  `__kubectl_get_resource` will look at the 'nouns' 
collected. In our example the only noun will be `pod`.  So it will call 
`__kubectl_parse_get pod`.  `__kubectl_parse_get` will actually call out to 
kubernetes and get any pods.  It will then set `COMPREPLY` to valid pods!
-
-## Have the completions code complete your 'nouns'
-
-In the above example "pod" was assumed to already be typed. But if you want 
`kubectl get [tab][tab]` to show a list of valid "nouns" you have to set them. 
Simplified code from `kubectl get` looks like:
-
-```go
-validArgs []string = { "pods", "nodes", "services", "replicationControllers" }
-
-cmd := &cobra.Command{
-       Use:     "get [(-o|--output=)json|yaml|template|...] (RESOURCE [NAME] | 
RESOURCE/NAME ...)",
-       Short:   "Display one or many resources",
-       Long:    get_long,
-       Example: get_example,
-       Run: func(cmd *cobra.Command, args []string) {
-               err := RunGet(f, out, cmd, args)
-               util.CheckErr(err)
-       },
-       ValidArgs: validArgs,
-}
-```
-
-Notice we put the "ValidArgs" on the "get" subcommand. Doing so will give 
results like
-
-```bash
-# kubectl get [tab][tab]
-nodes                 pods                    replicationControllers  services
-```
-
-## Mark flags as required
-
-Most of the time completions will only show subcommands. But if a flag is 
required to make a subcommand work, you probably want it to show up when the 
user types [tab][tab].  Marking a flag as 'Required' is incredibly easy.
-
-```go
-cmd.MarkFlagRequired("pod")
-cmd.MarkFlagRequired("container")
-```
-
-and you'll get something like
-
-```bash
-# kubectl exec [tab][tab][tab]
--c            --container=  -p            --pod=  
-```
-
-# Specify valid filename extensions for flags that take a filename
-
-In this example we use --filename= and expect to get a json or yaml file as 
the argument. To make this easier we annotate the --filename flag with valid 
filename extensions.
-
-```go
-       annotations := []string{"json", "yaml", "yml"}
-       annotation := make(map[string][]string)
-       annotation[cobra.BashCompFilenameExt] = annotations
-
-       flag := &pflag.Flag{
-               Name:        "filename",
-               Shorthand:   "f",
-               Usage:       usage,
-               Value:       value,
-               DefValue:    value.String(),
-               Annotations: annotation,
-       }
-       cmd.Flags().AddFlag(flag)
-```
-
-Now when you run a command with this filename flag you'll get something like
-
-```bash
-# kubectl create -f 
-test/                         example/                      rpmbuild/
-hello.yml                     test.json
-```
-
-So while there are many other files in the CWD it only shows me subdirs and 
those with valid extensions.

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/b002dd0c/newt/Godeps/_workspace/src/github.com/spf13/cobra/bash_completions_test.go
----------------------------------------------------------------------
diff --git 
a/newt/Godeps/_workspace/src/github.com/spf13/cobra/bash_completions_test.go 
b/newt/Godeps/_workspace/src/github.com/spf13/cobra/bash_completions_test.go
deleted file mode 100644
index 86f3d01..0000000
--- a/newt/Godeps/_workspace/src/github.com/spf13/cobra/bash_completions_test.go
+++ /dev/null
@@ -1,95 +0,0 @@
-package cobra
-
-import (
-       "bytes"
-       "fmt"
-       "os"
-       "strings"
-       "testing"
-)
-
-var _ = fmt.Println
-var _ = os.Stderr
-
-func checkOmit(t *testing.T, found, unexpected string) {
-       if strings.Contains(found, unexpected) {
-               t.Errorf("Unexpected response.\nGot: %q\nBut should not 
have!\n", unexpected)
-       }
-}
-
-func check(t *testing.T, found, expected string) {
-       if !strings.Contains(found, expected) {
-               t.Errorf("Unexpected response.\nExpecting to contain: \n 
%q\nGot:\n %q\n", expected, found)
-       }
-}
-
-// World worst custom function, just keep telling you to enter hello!
-const (
-       bash_completion_func = `__custom_func() {
-COMPREPLY=( "hello" )
-}
-`
-)
-
-func TestBashCompletions(t *testing.T) {
-       c := initializeWithRootCmd()
-       cmdEcho.AddCommand(cmdTimes)
-       c.AddCommand(cmdEcho, cmdPrint, cmdDeprecated, cmdColon)
-
-       // custom completion function
-       c.BashCompletionFunction = bash_completion_func
-
-       // required flag
-       c.MarkFlagRequired("introot")
-
-       // valid nouns
-       validArgs := []string{"pods", "nodes", "services", 
"replicationControllers"}
-       c.ValidArgs = validArgs
-
-       // filename
-       var flagval string
-       c.Flags().StringVar(&flagval, "filename", "", "Enter a filename")
-       c.MarkFlagFilename("filename", "json", "yaml", "yml")
-
-       // persistent filename
-       var flagvalPersistent string
-       c.PersistentFlags().StringVar(&flagvalPersistent, 
"persistent-filename", "", "Enter a filename")
-       c.MarkPersistentFlagFilename("persistent-filename")
-       c.MarkPersistentFlagRequired("persistent-filename")
-
-       // filename extensions
-       var flagvalExt string
-       c.Flags().StringVar(&flagvalExt, "filename-ext", "", "Enter a filename 
(extension limited)")
-       c.MarkFlagFilename("filename-ext")
-
-       // subdirectories in a given directory
-       var flagvalTheme string
-       c.Flags().StringVar(&flagvalTheme, "theme", "", "theme to use (located 
in /themes/THEMENAME/)")
-       c.Flags().SetAnnotation("theme", BashCompSubdirsInDir, 
[]string{"themes"})
-
-       out := new(bytes.Buffer)
-       c.GenBashCompletion(out)
-       str := out.String()
-
-       check(t, str, "_cobra-test")
-       check(t, str, "_cobra-test_echo")
-       check(t, str, "_cobra-test_echo_times")
-       check(t, str, "_cobra-test_print")
-       check(t, str, "_cobra-test_cmd__colon")
-
-       // check for required flags
-       check(t, str, `must_have_one_flag+=("--introot=")`)
-       check(t, str, `must_have_one_flag+=("--persistent-filename=")`)
-       // check for custom completion function
-       check(t, str, `COMPREPLY=( "hello" )`)
-       // check for required nouns
-       check(t, str, `must_have_one_noun+=("pods")`)
-       // check for filename extension flags
-       check(t, str, `flags_completion+=("_filedir")`)
-       // check for filename extension flags
-       check(t, str, `flags_completion+=("__handle_filename_extension_flag 
json|yaml|yml")`)
-       // check for subdirs_in_dir flags
-       check(t, str, `flags_completion+=("__handle_subdirs_in_dir_flag 
themes")`)
-
-       checkOmit(t, str, cmdDeprecated.Name())
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/b002dd0c/newt/Godeps/_workspace/src/github.com/spf13/cobra/cobra.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/spf13/cobra/cobra.go 
b/newt/Godeps/_workspace/src/github.com/spf13/cobra/cobra.go
deleted file mode 100644
index 7572ddf..0000000
--- a/newt/Godeps/_workspace/src/github.com/spf13/cobra/cobra.go
+++ /dev/null
@@ -1,171 +0,0 @@
-// Copyright © 2013 Steve Francia <s...@spf13.com>.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// Commands similar to git, go tools and other modern CLI tools
-// inspired by go, go-Commander, gh and subcommand
-
-package cobra
-
-import (
-       "fmt"
-       "io"
-       "reflect"
-       "strconv"
-       "strings"
-       "text/template"
-       "unicode"
-)
-
-var templateFuncs template.FuncMap = template.FuncMap{
-       "trim":               strings.TrimSpace,
-       "trimRightSpace":     trimRightSpace,
-       "appendIfNotPresent": appendIfNotPresent,
-       "rpad":               rpad,
-       "gt":                 Gt,
-       "eq":                 Eq,
-}
-
-var initializers []func()
-
-// automatic prefix matching can be a dangerous thing to automatically enable 
in CLI tools.
-// Set this to true to enable it
-var EnablePrefixMatching bool = false
-
-//AddTemplateFunc adds a template function that's available to Usage and Help
-//template generation.
-func AddTemplateFunc(name string, tmplFunc interface{}) {
-       templateFuncs[name] = tmplFunc
-}
-
-//AddTemplateFuncs adds multiple template functions availalble to Usage and
-//Help template generation.
-func AddTemplateFuncs(tmplFuncs template.FuncMap) {
-       for k, v := range tmplFuncs {
-               templateFuncs[k] = v
-       }
-}
-
-//OnInitialize takes a series of func() arguments and appends them to a slice 
of func().
-func OnInitialize(y ...func()) {
-       for _, x := range y {
-               initializers = append(initializers, x)
-       }
-}
-
-//Gt takes two types and checks whether the first type is greater than the 
second. In case of types Arrays, Chans,
-//Maps and Slices, Gt will compare their lengths. Ints are compared directly 
while strings are first parsed as
-//ints and then compared.
-func Gt(a interface{}, b interface{}) bool {
-       var left, right int64
-       av := reflect.ValueOf(a)
-
-       switch av.Kind() {
-       case reflect.Array, reflect.Chan, reflect.Map, reflect.Slice:
-               left = int64(av.Len())
-       case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, 
reflect.Int64:
-               left = av.Int()
-       case reflect.String:
-               left, _ = strconv.ParseInt(av.String(), 10, 64)
-       }
-
-       bv := reflect.ValueOf(b)
-
-       switch bv.Kind() {
-       case reflect.Array, reflect.Chan, reflect.Map, reflect.Slice:
-               right = int64(bv.Len())
-       case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, 
reflect.Int64:
-               right = bv.Int()
-       case reflect.String:
-               right, _ = strconv.ParseInt(bv.String(), 10, 64)
-       }
-
-       return left > right
-}
-
-//Eq takes two types and checks whether they are equal. Supported types are 
int and string. Unsupported types will panic.
-func Eq(a interface{}, b interface{}) bool {
-       av := reflect.ValueOf(a)
-       bv := reflect.ValueOf(b)
-
-       switch av.Kind() {
-       case reflect.Array, reflect.Chan, reflect.Map, reflect.Slice:
-               panic("Eq called on unsupported type")
-       case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, 
reflect.Int64:
-               return av.Int() == bv.Int()
-       case reflect.String:
-               return av.String() == bv.String()
-       }
-       return false
-}
-
-func trimRightSpace(s string) string {
-       return strings.TrimRightFunc(s, unicode.IsSpace)
-}
-
-// appendIfNotPresent will append stringToAppend to the end of s, but only if 
it's not yet present in s
-func appendIfNotPresent(s, stringToAppend string) string {
-       if strings.Contains(s, stringToAppend) {
-               return s
-       }
-       return s + " " + stringToAppend
-}
-
-//rpad adds padding to the right of a string
-func rpad(s string, padding int) string {
-       template := fmt.Sprintf("%%-%ds", padding)
-       return fmt.Sprintf(template, s)
-}
-
-// tmpl executes the given template text on data, writing the result to w.
-func tmpl(w io.Writer, text string, data interface{}) error {
-       t := template.New("top")
-       t.Funcs(templateFuncs)
-       template.Must(t.Parse(text))
-       return t.Execute(w, data)
-}
-
-// ld compares two strings and returns the levenshtein distance between them
-func ld(s, t string, ignoreCase bool) int {
-       if ignoreCase {
-               s = strings.ToLower(s)
-               t = strings.ToLower(t)
-       }
-       d := make([][]int, len(s)+1)
-       for i := range d {
-               d[i] = make([]int, len(t)+1)
-       }
-       for i := range d {
-               d[i][0] = i
-       }
-       for j := range d[0] {
-               d[0][j] = j
-       }
-       for j := 1; j <= len(t); j++ {
-               for i := 1; i <= len(s); i++ {
-                       if s[i-1] == t[j-1] {
-                               d[i][j] = d[i-1][j-1]
-                       } else {
-                               min := d[i-1][j]
-                               if d[i][j-1] < min {
-                                       min = d[i][j-1]
-                               }
-                               if d[i-1][j-1] < min {
-                                       min = d[i-1][j-1]
-                               }
-                               d[i][j] = min + 1
-                       }
-               }
-
-       }
-       return d[len(s)][len(t)]
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/b002dd0c/newt/Godeps/_workspace/src/github.com/spf13/cobra/cobra/cmd/add.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/spf13/cobra/cobra/cmd/add.go 
b/newt/Godeps/_workspace/src/github.com/spf13/cobra/cobra/cmd/add.go
deleted file mode 100644
index b89d4c4..0000000
--- a/newt/Godeps/_workspace/src/github.com/spf13/cobra/cobra/cmd/add.go
+++ /dev/null
@@ -1,128 +0,0 @@
-// Copyright © 2015 Steve Francia <s...@spf13.com>.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package cmd
-
-import (
-       "fmt"
-       "path/filepath"
-       "strings"
-
-       "github.com/spf13/cobra"
-       "github.com/spf13/viper"
-)
-
-func init() {
-       RootCmd.AddCommand(addCmd)
-}
-
-var pName string
-
-// initialize Command
-var addCmd = &cobra.Command{
-       Use:     "add [command name]",
-       Aliases: []string{"command"},
-       Short:   "Add a command to a Cobra Application",
-       Long: `Add (cobra add) will create a new command, with a license and
-the appropriate structure for a Cobra-based CLI application,
-and register it to its parent (default RootCmd).
-
-If you want your command to be public, pass in the command name
-with an initial uppercase letter.
-
-Example: cobra add server  -> resulting in a new cmd/server.go
-  `,
-
-       Run: func(cmd *cobra.Command, args []string) {
-               if len(args) != 1 {
-                       er("add needs a name for the command")
-               }
-               guessProjectPath()
-               createCmdFile(args[0])
-       },
-}
-
-func init() {
-       addCmd.Flags().StringVarP(&pName, "parent", "p", "RootCmd", "name of 
parent command for this command")
-}
-
-func parentName() string {
-       if !strings.HasSuffix(strings.ToLower(pName), "cmd") {
-               return pName + "Cmd"
-       }
-
-       return pName
-}
-
-func createCmdFile(cmdName string) {
-       lic := getLicense()
-
-       template := `{{ comment .copyright }}
-{{ comment .license }}
-
-package cmd
-
-import (
-       "fmt"
-
-       "github.com/spf13/cobra"
-)
-
-// {{.cmdName}}Cmd represents the {{.cmdName}} command
-var {{ .cmdName }}Cmd = &cobra.Command{
-       Use:   "{{ .cmdName }}",
-       Short: "A brief description of your command",
-       Long: ` + "`" + `A longer description that spans multiple lines and 
likely contains examples
-and usage of using your command. For example:
-
-Cobra is a CLI library for Go that empowers applications.
-This application is a tool to generate the needed files
-to quickly create a Cobra application.` + "`" + `,
-       Run: func(cmd *cobra.Command, args []string) {
-               // TODO: Work your own magic here
-               fmt.Println("{{ .cmdName }} called")
-       },
-}
-
-func init() {
-       {{ .parentName }}.AddCommand({{ .cmdName }}Cmd)
-
-       // Here you will define your flags and configuration settings.
-
-       // Cobra supports Persistent Flags which will work for this command
-       // and all subcommands, e.g.:
-       // {{.cmdName}}Cmd.PersistentFlags().String("foo", "", "A help for foo")
-
-       // Cobra supports local flags which will only run when this command
-       // is called directly, e.g.:
-       // {{.cmdName}}Cmd.Flags().BoolP("toggle", "t", false, "Help message 
for toggle")
-
-}
-`
-
-       var data map[string]interface{}
-       data = make(map[string]interface{})
-
-       data["copyright"] = copyrightLine()
-       data["license"] = lic.Header
-       data["appName"] = projectName()
-       data["viper"] = viper.GetBool("useViper")
-       data["parentName"] = parentName()
-       data["cmdName"] = cmdName
-
-       err := writeTemplateToFile(filepath.Join(ProjectPath(), guessCmdDir()), 
cmdName+".go", template, data)
-       if err != nil {
-               er(err)
-       }
-       fmt.Println(cmdName, "created at", filepath.Join(ProjectPath(), 
guessCmdDir(), cmdName+".go"))
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/b002dd0c/newt/Godeps/_workspace/src/github.com/spf13/cobra/cobra/cmd/helpers.go
----------------------------------------------------------------------
diff --git 
a/newt/Godeps/_workspace/src/github.com/spf13/cobra/cobra/cmd/helpers.go 
b/newt/Godeps/_workspace/src/github.com/spf13/cobra/cobra/cmd/helpers.go
deleted file mode 100644
index 8730062..0000000
--- a/newt/Godeps/_workspace/src/github.com/spf13/cobra/cobra/cmd/helpers.go
+++ /dev/null
@@ -1,347 +0,0 @@
-// Copyright © 2015 Steve Francia <s...@spf13.com>.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package cmd
-
-import (
-       "bytes"
-       "fmt"
-       "io"
-       "os"
-       "path/filepath"
-       "strings"
-       "text/template"
-       "time"
-
-       "github.com/spf13/viper"
-)
-
-// var BaseDir = ""
-// var AppName = ""
-// var CommandDir = ""
-
-var funcMap template.FuncMap
-var projectPath = ""
-var inputPath = ""
-var projectBase = ""
-
-// for testing only
-var testWd = ""
-
-var cmdDirs = []string{"cmd", "cmds", "command", "commands"}
-
-func init() {
-       funcMap = template.FuncMap{
-               "comment": commentifyString,
-       }
-}
-
-func er(msg interface{}) {
-       fmt.Println("Error:", msg)
-       os.Exit(-1)
-}
-
-// Check if a file or directory exists.
-func exists(path string) (bool, error) {
-       _, err := os.Stat(path)
-       if err == nil {
-               return true, nil
-       }
-       if os.IsNotExist(err) {
-               return false, nil
-       }
-       return false, err
-}
-
-func ProjectPath() string {
-       if projectPath == "" {
-               guessProjectPath()
-       }
-
-       return projectPath
-}
-
-// wrapper of the os package so we can test better
-func getWd() (string, error) {
-       if testWd == "" {
-               return os.Getwd()
-       }
-       return testWd, nil
-}
-
-func guessCmdDir() string {
-       guessProjectPath()
-       if b, _ := isEmpty(projectPath); b {
-               return "cmd"
-       }
-
-       files, _ := filepath.Glob(projectPath + string(os.PathSeparator) + "c*")
-       for _, f := range files {
-               for _, c := range cmdDirs {
-                       if f == c {
-                               return c
-                       }
-               }
-       }
-
-       return "cmd"
-}
-
-func guessImportPath() string {
-       guessProjectPath()
-
-       if !strings.HasPrefix(projectPath, getSrcPath()) {
-               er("Cobra only supports project within $GOPATH")
-       }
-
-       return filepath.ToSlash(filepath.Clean(strings.TrimPrefix(projectPath, 
getSrcPath())))
-}
-
-func getSrcPath() string {
-       return filepath.Join(os.Getenv("GOPATH"), "src") + 
string(os.PathSeparator)
-}
-
-func projectName() string {
-       return filepath.Base(ProjectPath())
-}
-
-func guessProjectPath() {
-       // if no path is provided... assume CWD.
-       if inputPath == "" {
-               x, err := getWd()
-               if err != nil {
-                       er(err)
-               }
-
-               // inspect CWD
-               base := filepath.Base(x)
-
-               // if we are in the cmd directory.. back up
-               for _, c := range cmdDirs {
-                       if base == c {
-                               projectPath = filepath.Dir(x)
-                               return
-                       }
-               }
-
-               if projectPath == "" {
-                       projectPath = filepath.Clean(x)
-                       return
-               }
-       }
-
-       srcPath := getSrcPath()
-       // if provided, inspect for logical locations
-       if strings.ContainsRune(inputPath, os.PathSeparator) {
-               if filepath.IsAbs(inputPath) || filepath.HasPrefix(inputPath, 
string(os.PathSeparator)) {
-                       // if Absolute, use it
-                       projectPath = filepath.Clean(inputPath)
-                       return
-               }
-               // If not absolute but contains slashes,
-               // assuming it means create it from $GOPATH
-               count := strings.Count(inputPath, string(os.PathSeparator))
-
-               switch count {
-               // If only one directory deep, assume "github.com"
-               case 1:
-                       projectPath = filepath.Join(srcPath, "github.com", 
inputPath)
-                       return
-               case 2:
-                       projectPath = filepath.Join(srcPath, inputPath)
-                       return
-               default:
-                       er("Unknown directory")
-               }
-       } else {
-               // hardest case.. just a word.
-               if projectBase == "" {
-                       x, err := getWd()
-                       if err == nil {
-                               projectPath = filepath.Join(x, inputPath)
-                               return
-                       }
-                       er(err)
-               } else {
-                       projectPath = filepath.Join(srcPath, projectBase, 
inputPath)
-                       return
-               }
-       }
-}
-
-// isEmpty checks if a given path is empty.
-func isEmpty(path string) (bool, error) {
-       if b, _ := exists(path); !b {
-               return false, fmt.Errorf("%q path does not exist", path)
-       }
-       fi, err := os.Stat(path)
-       if err != nil {
-               return false, err
-       }
-       if fi.IsDir() {
-               f, err := os.Open(path)
-               // FIX: Resource leak - f.close() should be called here by 
defer or is missed
-               // if the err != nil branch is taken.
-               defer f.Close()
-               if err != nil {
-                       return false, err
-               }
-               list, err := f.Readdir(-1)
-               // f.Close() - see bug fix above
-               return len(list) == 0, nil
-       }
-       return fi.Size() == 0, nil
-}
-
-// isDir checks if a given path is a directory.
-func isDir(path string) (bool, error) {
-       fi, err := os.Stat(path)
-       if err != nil {
-               return false, err
-       }
-       return fi.IsDir(), nil
-}
-
-// dirExists checks if a path exists and is a directory.
-func dirExists(path string) (bool, error) {
-       fi, err := os.Stat(path)
-       if err == nil && fi.IsDir() {
-               return true, nil
-       }
-       if os.IsNotExist(err) {
-               return false, nil
-       }
-       return false, err
-}
-
-func writeTemplateToFile(path string, file string, template string, data 
interface{}) error {
-       filename := filepath.Join(path, file)
-
-       r, err := templateToReader(template, data)
-
-       if err != nil {
-               return err
-       }
-
-       err = safeWriteToDisk(filename, r)
-
-       if err != nil {
-               return err
-       }
-       return nil
-}
-
-func writeStringToFile(path, file, text string) error {
-       filename := filepath.Join(path, file)
-
-       r := strings.NewReader(text)
-       err := safeWriteToDisk(filename, r)
-
-       if err != nil {
-               return err
-       }
-       return nil
-}
-
-func templateToReader(tpl string, data interface{}) (io.Reader, error) {
-       tmpl := template.New("")
-       tmpl.Funcs(funcMap)
-       tmpl, err := tmpl.Parse(tpl)
-
-       if err != nil {
-               return nil, err
-       }
-       buf := new(bytes.Buffer)
-       err = tmpl.Execute(buf, data)
-
-       return buf, err
-}
-
-// Same as WriteToDisk but checks to see if file/directory already exists.
-func safeWriteToDisk(inpath string, r io.Reader) (err error) {
-       dir, _ := filepath.Split(inpath)
-       ospath := filepath.FromSlash(dir)
-
-       if ospath != "" {
-               err = os.MkdirAll(ospath, 0777) // rwx, rw, r
-               if err != nil {
-                       return
-               }
-       }
-
-       ex, err := exists(inpath)
-       if err != nil {
-               return
-       }
-       if ex {
-               return fmt.Errorf("%v already exists", inpath)
-       }
-
-       file, err := os.Create(inpath)
-       if err != nil {
-               return
-       }
-       defer file.Close()
-
-       _, err = io.Copy(file, r)
-       return
-}
-
-func getLicense() License {
-       l := whichLicense()
-       if l != "" {
-               if x, ok := Licenses[l]; ok {
-                       return x
-               }
-       }
-
-       return Licenses["apache"]
-}
-
-func whichLicense() string {
-       // if explicitly flagged, use that
-       if userLicense != "" {
-               return matchLicense(userLicense)
-       }
-
-       // if already present in the project, use that
-       // TODO: Inspect project for existing license
-
-       // default to viper's setting
-
-       return matchLicense(viper.GetString("license"))
-}
-
-func copyrightLine() string {
-       author := viper.GetString("author")
-       year := time.Now().Format("2006")
-
-       return "Copyright © " + year + " " + author
-}
-
-func commentifyString(in string) string {
-       var newlines []string
-       lines := strings.Split(in, "\n")
-       for _, x := range lines {
-               if !strings.HasPrefix(x, "//") {
-                       if x != "" {
-                               newlines = append(newlines, "// "+x)
-                       } else {
-                               newlines = append(newlines, "//")
-                       }
-               } else {
-                       newlines = append(newlines, x)
-               }
-       }
-       return strings.Join(newlines, "\n")
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/b002dd0c/newt/Godeps/_workspace/src/github.com/spf13/cobra/cobra/cmd/helpers_test.go
----------------------------------------------------------------------
diff --git 
a/newt/Godeps/_workspace/src/github.com/spf13/cobra/cobra/cmd/helpers_test.go 
b/newt/Godeps/_workspace/src/github.com/spf13/cobra/cobra/cmd/helpers_test.go
deleted file mode 100644
index bd0f759..0000000
--- 
a/newt/Godeps/_workspace/src/github.com/spf13/cobra/cobra/cmd/helpers_test.go
+++ /dev/null
@@ -1,40 +0,0 @@
-package cmd
-
-import (
-       "fmt"
-       "os"
-       "path/filepath"
-       "testing"
-)
-
-var _ = fmt.Println
-var _ = os.Stderr
-
-func checkGuess(t *testing.T, wd, input, expected string) {
-       testWd = wd
-       inputPath = input
-       guessProjectPath()
-
-       if projectPath != expected {
-               t.Errorf("Unexpected Project Path. \n Got: %q\nExpected: %q\n", 
projectPath, expected)
-       }
-
-       reset()
-}
-
-func reset() {
-       testWd = ""
-       inputPath = ""
-       projectPath = ""
-}
-
-func TestProjectPath(t *testing.T) {
-       checkGuess(t, "", filepath.Join("github.com", "spf13", "hugo"), 
filepath.Join(getSrcPath(), "github.com", "spf13", "hugo"))
-       checkGuess(t, "", filepath.Join("spf13", "hugo"), 
filepath.Join(getSrcPath(), "github.com", "spf13", "hugo"))
-       checkGuess(t, "", filepath.Join("/", "bar", "foo"), filepath.Join("/", 
"bar", "foo"))
-       checkGuess(t, "/bar/foo", "baz", filepath.Join("/", "bar", "foo", 
"baz"))
-       checkGuess(t, "/bar/foo/cmd", "", filepath.Join("/", "bar", "foo"))
-       checkGuess(t, "/bar/foo/command", "", filepath.Join("/", "bar", "foo"))
-       checkGuess(t, "/bar/foo/commands", "", filepath.Join("/", "bar", "foo"))
-       checkGuess(t, "github.com/spf13/hugo/../hugo", "", 
filepath.Join("github.com", "spf13", "hugo"))
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/b002dd0c/newt/Godeps/_workspace/src/github.com/spf13/cobra/cobra/cmd/init.go
----------------------------------------------------------------------
diff --git 
a/newt/Godeps/_workspace/src/github.com/spf13/cobra/cobra/cmd/init.go 
b/newt/Godeps/_workspace/src/github.com/spf13/cobra/cobra/cmd/init.go
deleted file mode 100644
index 8822c81..0000000
--- a/newt/Godeps/_workspace/src/github.com/spf13/cobra/cobra/cmd/init.go
+++ /dev/null
@@ -1,226 +0,0 @@
-// Copyright © 2015 Steve Francia <s...@spf13.com>.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package cmd
-
-import (
-       "fmt"
-       "os"
-       "strings"
-
-       "github.com/spf13/cobra"
-       "github.com/spf13/viper"
-)
-
-func init() {
-       RootCmd.AddCommand(initCmd)
-}
-
-// initialize Command
-var initCmd = &cobra.Command{
-       Use:     "init [name]",
-       Aliases: []string{"initialize", "initialise", "create"},
-       Short:   "Initialize a Cobra Application",
-       Long: `Initialize (cobra init) will create a new application, with a 
license
-and the appropriate structure for a Cobra-based CLI application.
-
-  * If a name is provided, it will be created in the current directory;
-  * If no name is provided, the current directory will be assumed;
-  * If a relative path is provided, it will be created inside $GOPATH
-    (e.g. github.com/spf13/hugo);
-  * If an absolute path is provided, it will be created;
-  * If the directory already exists but is empty, it will be used.
-
-Init will not use an existing directory with contents.`,
-
-       Run: func(cmd *cobra.Command, args []string) {
-               switch len(args) {
-               case 0:
-                       inputPath = ""
-
-               case 1:
-                       inputPath = args[0]
-
-               default:
-                       er("init doesn't support more than 1 parameter")
-               }
-               guessProjectPath()
-               initializePath(projectPath)
-       },
-}
-
-func initializePath(path string) {
-       b, err := exists(path)
-       if err != nil {
-               er(err)
-       }
-
-       if !b { // If path doesn't yet exist, create it
-               err := os.MkdirAll(path, os.ModePerm)
-               if err != nil {
-                       er(err)
-               }
-       } else { // If path exists and is not empty don't use it
-               empty, err := exists(path)
-               if err != nil {
-                       er(err)
-               }
-               if !empty {
-                       er("Cobra will not create a new project in a non empty 
directory")
-               }
-       }
-       // We have a directory and it's empty.. Time to initialize it.
-
-       createLicenseFile()
-       createMainFile()
-       createRootCmdFile()
-}
-
-func createLicenseFile() {
-       lic := getLicense()
-
-       template := lic.Text
-
-       var data map[string]interface{}
-       data = make(map[string]interface{})
-
-       // Try to remove the email address, if any
-       data["copyright"] = strings.Split(copyrightLine(), " <")[0]
-
-       err := writeTemplateToFile(ProjectPath(), "LICENSE", template, data)
-       _ = err
-       // if err != nil {
-       //      er(err)
-       // }
-}
-
-func createMainFile() {
-       lic := getLicense()
-
-       template := `{{ comment .copyright }}
-{{ comment .license }}
-
-package main
-
-import "{{ .importpath }}"
-
-func main() {
-       cmd.Execute()
-}
-`
-       var data map[string]interface{}
-       data = make(map[string]interface{})
-
-       data["copyright"] = copyrightLine()
-       data["license"] = lic.Header
-       data["importpath"] = guessImportPath() + "/" + guessCmdDir()
-
-       err := writeTemplateToFile(ProjectPath(), "main.go", template, data)
-       _ = err
-       // if err != nil {
-       //      er(err)
-       // }
-}
-
-func createRootCmdFile() {
-       lic := getLicense()
-
-       template := `{{ comment .copyright }}
-{{ comment .license }}
-
-package cmd
-
-import (
-       "fmt"
-       "os"
-
-       "github.com/spf13/cobra"
-{{ if .viper }}        "github.com/spf13/viper"
-{{ end }})
-{{if .viper}}
-var cfgFile string
-{{ end }}
-// This represents the base command when called without any subcommands
-var RootCmd = &cobra.Command{
-       Use:   "{{ .appName }}",
-       Short: "A brief description of your application",
-       Long: ` + "`" + `A longer description that spans multiple lines and 
likely contains
-examples and usage of using your application. For example:
-
-Cobra is a CLI library for Go that empowers applications.
-This application is a tool to generate the needed files
-to quickly create a Cobra application.` + "`" + `,
-// Uncomment the following line if your bare application
-// has an action associated with it:
-//     Run: func(cmd *cobra.Command, args []string) { },
-}
-
-// Execute adds all child commands to the root command sets flags 
appropriately.
-// This is called by main.main(). It only needs to happen once to the rootCmd.
-func Execute() {
-       if err := RootCmd.Execute(); err != nil {
-               fmt.Println(err)
-               os.Exit(-1)
-       }
-}
-
-func init() {
-{{ if .viper }}        cobra.OnInitialize(initConfig)
-
-{{ end }}      // Here you will define your flags and configuration settings.
-       // Cobra supports Persistent Flags, which, if defined here,
-       // will be global for your application.
-{{ if .viper }}
-       RootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config 
file (default is $HOME/.{{ .appName }}.yaml)")
-{{ else }}
-       // RootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config 
file (default is $HOME/.{{ .appName }}.yaml)")
-{{ end }}      // Cobra also supports local flags, which will only run
-       // when this action is called directly.
-       RootCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
-}
-{{ if .viper }}
-// initConfig reads in config file and ENV variables if set.
-func initConfig() {
-       if cfgFile != "" { // enable ability to specify config file via flag
-               viper.SetConfigFile(cfgFile)
-       }
-
-       viper.SetConfigName(".{{ .appName }}") // name of config file (without 
extension)
-       viper.AddConfigPath("$HOME")  // adding home directory as first search 
path
-       viper.AutomaticEnv()          // read in environment variables that 
match
-
-       // If a config file is found, read it in.
-       if err := viper.ReadInConfig(); err == nil {
-               fmt.Println("Using config file:", viper.ConfigFileUsed())
-       }
-}
-{{ end }}`
-
-       var data map[string]interface{}
-       data = make(map[string]interface{})
-
-       data["copyright"] = copyrightLine()
-       data["license"] = lic.Header
-       data["appName"] = projectName()
-       data["viper"] = viper.GetBool("useViper")
-
-       err := 
writeTemplateToFile(ProjectPath()+string(os.PathSeparator)+guessCmdDir(), 
"root.go", template, data)
-       if err != nil {
-               er(err)
-       }
-
-       fmt.Println("Your Cobra application is ready at")
-       fmt.Println(ProjectPath())
-       fmt.Println("Give it a try by going there and running `go run main.go`")
-       fmt.Println("Add commands to it by running `cobra add [cmdname]`")
-}

Reply via email to