You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by sv...@apache.org on 2016/10/25 19:11:12 UTC
[18/19] brooklyn-client git commit: Fix delete usage
Fix delete usage
Project: http://git-wip-us.apache.org/repos/asf/brooklyn-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-client/commit/404e25f2
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-client/tree/404e25f2
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-client/diff/404e25f2
Branch: refs/heads/master
Commit: 404e25f224774fa07b428a9f2828575a948c3aee
Parents: d892964
Author: Geoff Macartney <ge...@cloudsoftcorp.com>
Authored: Tue Oct 25 17:21:28 2016 +0100
Committer: Geoff Macartney <ge...@cloudsoftcorp.com>
Committed: Tue Oct 25 17:21:28 2016 +0100
----------------------------------------------------------------------
cli/commands/catalog-delete.go | 10 ++++------
cli/commands/catalog.go | 2 +-
2 files changed, 5 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/404e25f2/cli/commands/catalog-delete.go
----------------------------------------------------------------------
diff --git a/cli/commands/catalog-delete.go b/cli/commands/catalog-delete.go
index 8b6a33a..76875fd 100644
--- a/cli/commands/catalog-delete.go
+++ b/cli/commands/catalog-delete.go
@@ -43,13 +43,11 @@ func (cmd *DeleteCatalogItem) Metadata() command_metadata.CommandMetadata {
return command_metadata.CommandMetadata{
Name: "delete",
Description: "delete the given catalog item",
- Usage: "BROOKLYN_NAME catalog " + deleteCommandName +
- " TYPE ITEM_ID:VERSION (where TYPE is one of application, location, entity, policy, may be abbreviated)",
+ Usage: "BROOKLYN_NAME catalog " + deleteCommandUsage,
}
}
-const deleteCommandName = "delete"
-
+const deleteCommandUsage = "delete TYPE ITEM_ID:VERSION (where TYPE is one of application, location, entity, policy; may be abbreviated)"
func (cmd *DeleteCatalogItem) Run(scope scope.Scope, c *cli.Context) {
if err := net.VerifyLoginURL(cmd.network); err != nil {
@@ -57,11 +55,11 @@ func (cmd *DeleteCatalogItem) Run(scope scope.Scope, c *cli.Context) {
}
args := c.Args()
if len(args) != 2 {
- error_handler.ErrorExit("command requires arguments TYPE ITEM_ID:VERSION")
+ error_handler.ErrorExit(c.App.Name + " " + deleteCommandUsage)
}
itemVersion := strings.Split(args.Get(1), ":")
if len(itemVersion) != 2 {
- error_handler.ErrorExit("command requires arguments TYPE ITEM_ID:VERSION")
+ error_handler.ErrorExit(c.App.Name + " " + deleteCommandUsage)
}
itemId := itemVersion[0]
version := itemVersion[1]
http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/404e25f2/cli/commands/catalog.go
----------------------------------------------------------------------
diff --git a/cli/commands/catalog.go b/cli/commands/catalog.go
index 117dcb7..3d5e525 100644
--- a/cli/commands/catalog.go
+++ b/cli/commands/catalog.go
@@ -55,7 +55,7 @@ var catalogCommands = []string{
AddCatalogCommand,
DeleteCatalogCommand,
}
-var catalogCommandsUsage = strings.Join(catalogCommands, " | ")
+var catalogCommandsUsage = "list TYPE | add FILE/URL | delete TYPE ID:VERSION"
type CatalogItemType int
const (