You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by ge...@apache.org on 2017/04/27 09:44:48 UTC

[2/6] brooklyn-client git commit: display nice error if argument is omitted

display nice error if argument is omitted


Project: http://git-wip-us.apache.org/repos/asf/brooklyn-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-client/commit/d2203982
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-client/tree/d2203982
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-client/diff/d2203982

Branch: refs/heads/master
Commit: d2203982604ede161d87b8ae7d4ba0ad657bcf91
Parents: e974f73
Author: Alex Heneveld <al...@cloudsoftcorp.com>
Authored: Mon Apr 24 15:11:22 2017 +0100
Committer: Alex Heneveld <al...@cloudsoftcorp.com>
Committed: Mon Apr 24 15:13:30 2017 +0100

----------------------------------------------------------------------
 cli/commands/catalog-add.go | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/d2203982/cli/commands/catalog-add.go
----------------------------------------------------------------------
diff --git a/cli/commands/catalog-add.go b/cli/commands/catalog-add.go
index 102f213..0f67152 100644
--- a/cli/commands/catalog-add.go
+++ b/cli/commands/catalog-add.go
@@ -48,6 +48,9 @@ func (cmd *CatalogAdd) Metadata() command_metadata.CommandMetadata {
 }
 
 func (cmd *CatalogAdd) Run(scope scope.Scope, c *cli.Context) {
+        if c.Args().First() == "" {
+                error_handler.ErrorExit("A filename or URL must be provided as the first argument", error_handler.CLIUsageErrorExitCode)
+        }
 	if err := net.VerifyLoginURL(cmd.network); err != nil {
 		error_handler.ErrorExit(err)
 	}