added namespace argument to list commands
diff --git a/commands/action.go b/commands/action.go
index 95e47d9..61e1274 100644
--- a/commands/action.go
+++ b/commands/action.go
@@ -175,10 +175,32 @@
}
var actionListCmd = &cobra.Command{
- Use: "list",
+ Use: "list <namespace string>",
Short: "list all actions",
Run: func(cmd *cobra.Command, args []string) {
+ var err error
+ qName := qualifiedName{}
+ if len(args) == 1 {
+ qName, err = parseQualifiedName(args[0])
+ if err != nil {
+ fmt.Printf("error: %s", err)
+ return
+ }
+ ns := qName.namespace
+ if len(ns) == 0 {
+ err = errors.New("No valid namespace detected. Make sure that namespace argument is preceded by a \"/\"")
+ fmt.Printf("error: %s\n", err)
+ return
+ }
+
+ client.Namespace = ns
+
+ if pkg := qName.packageName; len(pkg) > 0 {
+ // todo :: scope call to package
+ }
+ }
+
options := &whisk.ActionListOptions{
Skip: flags.common.skip,
Limit: flags.common.limit,
diff --git a/commands/activation.go b/commands/activation.go
index 418ee01..8408aad 100644
--- a/commands/activation.go
+++ b/commands/activation.go
@@ -26,10 +26,32 @@
}
var activationListCmd = &cobra.Command{
- Use: "list",
+ Use: "list <namespace string>",
Short: "list activations",
Run: func(cmd *cobra.Command, args []string) {
+ var err error
+ qName := qualifiedName{}
+ if len(args) == 1 {
+ qName, err = parseQualifiedName(args[0])
+ if err != nil {
+ fmt.Printf("error: %s", err)
+ return
+ }
+ ns := qName.namespace
+ if len(ns) == 0 {
+ err = errors.New("No valid namespace detected. Make sure that namespace argument is preceded by a \"/\"")
+ fmt.Printf("error: %s\n", err)
+ return
+ }
+
+ client.Namespace = ns
+
+ if pkg := qName.packageName; len(pkg) > 0 {
+ // todo :: scope call to package
+ }
+ }
+
options := &whisk.ActivationListOptions{
Name: flags.activation.action,
Limit: flags.common.limit,
diff --git a/commands/package.go b/commands/package.go
index 43e8706..5d6a310 100644
--- a/commands/package.go
+++ b/commands/package.go
@@ -21,6 +21,8 @@
Short: "bind parameters to the package",
Run: func(cmd *cobra.Command, args []string) {
+ fmt.Println("TODO :: this command has been commented out because it is out of date")
+
// var err error
// if len(args) != 2 {
// err = errors.New("Invalid argument list")
@@ -220,11 +222,27 @@
}
var packageListCmd = &cobra.Command{
- Use: "list",
+ Use: "list <namespace string>",
Short: "list all packages",
Run: func(cmd *cobra.Command, args []string) {
var err error
+ qName := qualifiedName{}
+ if len(args) == 1 {
+ qName, err = parseQualifiedName(args[0])
+ if err != nil {
+ fmt.Printf("error: %s", err)
+ return
+ }
+ ns := qName.namespace
+ if len(ns) == 0 {
+ err = errors.New("No valid namespace detected. Make sure that namespace argument is preceded by a \"/\"")
+ fmt.Printf("error: %s\n", err)
+ return
+ }
+
+ client.Namespace = ns
+ }
options := &whisk.PackageListOptions{
Skip: flags.common.skip,
diff --git a/commands/rule.go b/commands/rule.go
index ff3b6a4..3fc1cd6 100644
--- a/commands/rule.go
+++ b/commands/rule.go
@@ -203,10 +203,31 @@
}
var ruleListCmd = &cobra.Command{
- Use: "list",
+ Use: "list <namespace string>",
Short: "list all rules",
Run: func(cmd *cobra.Command, args []string) {
+ var err error
+ qName := qualifiedName{}
+ if len(args) == 1 {
+ qName, err = parseQualifiedName(args[0])
+ if err != nil {
+ fmt.Printf("error: %s", err)
+ return
+ }
+ ns := qName.namespace
+ if len(ns) == 0 {
+ err = errors.New("No valid namespace detected. Make sure that namespace argument is preceded by a \"/\"")
+ fmt.Printf("error: %s\n", err)
+ return
+ }
+
+ client.Namespace = ns
+
+ if pkg := qName.packageName; len(pkg) > 0 {
+ // todo :: scope call to package
+ }
+ }
ruleListOptions := &whisk.RuleListOptions{
Skip: flags.common.skip,
diff --git a/commands/trigger.go b/commands/trigger.go
index 4836112..3323caa 100644
--- a/commands/trigger.go
+++ b/commands/trigger.go
@@ -204,10 +204,32 @@
}
var triggerListCmd = &cobra.Command{
- Use: "list",
+ Use: "list <namespace string>",
Short: "list all triggers",
Run: func(cmd *cobra.Command, args []string) {
+ var err error
+ qName := qualifiedName{}
+ if len(args) == 1 {
+ qName, err = parseQualifiedName(args[0])
+ if err != nil {
+ fmt.Printf("error: %s", err)
+ return
+ }
+ ns := qName.namespace
+ if len(ns) == 0 {
+ err = errors.New("No valid namespace detected. Make sure that namespace argument is preceded by a \"/\"")
+ fmt.Printf("error: %s\n", err)
+ return
+ }
+
+ client.Namespace = ns
+
+ if pkg := qName.packageName; len(pkg) > 0 {
+ // todo :: scope call to package
+ }
+ }
+
options := &whisk.TriggerListOptions{
Skip: flags.common.skip,
Limit: flags.common.limit,