bpoole16 commented on a change in pull request #2334: (Review) Added --last 
Activation Flag 
URL: 
https://github.com/apache/incubator-openwhisk/pull/2334#discussion_r126158776
 
 

 ##########
 File path: tools/cli/go-whisk-cli/commands/activation.go
 ##########
 @@ -262,24 +262,26 @@ func lastFlag(args []string) ([]string, error) {
             errStr := wski18n.T("Activation list does not contain any 
activations.")
             whiskErr := whisk.MakeWskError(errors.New(errStr), 
whisk.EXITCODE_ERR_GENERAL, whisk.DISPLAY_MSG, whisk.DISPLAY_USAGE)
             return args, whiskErr
-        } else {
-            if len(args) == 0 {
-                whisk.Debug(whisk.DbgInfo, "Appending most recent activation 
ID(%s) into args\n", activations[0].ActivationID)
-                args = append(args, activations[0].ActivationID)
-            } else if len(args) == 1 && len(args[0]) != 32 {    // Checks to 
see if filter field is given and not ID
-                  whisk.Debug(whisk.DbgInfo, "Appending most recent activation 
ID(%s) into args\n", activations[0].ActivationID)
-                  args = append(args, activations[0].ActivationID)
-                  whisk.Debug(whisk.DbgInfo, "Allocating appended ID to 
correct position in args\n")
-                  args[0], args[1] = args[1], args[0]    // IDs should be 
located at args[0], if a filter field is given it has to be moved to args[0]
-            } else if len(args[0]) == 32 {    // Checks conflict between ID 
and --last
-                  whisk.Debug(whisk.DbgError,"Could not use activation ID with 
--last flag\n")
-                  errStr := wski18n.T("When specifying an activation ID, do 
not use the --last flag.")
-                  whiskErr := whisk.MakeWskError(errors.New(errStr), 
whisk.EXITCODE_ERR_GENERAL, whisk.DISPLAY_MSG, whisk.DISPLAY_USAGE)
-                  return args, whiskErr
-            }
         }
+        if len(args) == 0 {
+            whisk.Debug(whisk.DbgInfo, "Appending most recent activation 
ID(%s) into args\n", activations[0].ActivationID)
+            args = append(args, activations[0].ActivationID)
+        } else {
+                       filterExists := fieldExists(&whisk.Activation{}, 
args[0])
+                       if filterExists == true {    // Checks to see if filter 
field is given and not ID
 
 Review comment:
   Not sure why it is doing this, Doesn't look like this in my IDE.
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to