This is an automated email from the ASF dual-hosted git repository.
rabbah pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-cli.git
The following commit(s) were added to refs/heads/master by this push:
new 0f96fa4 Add --logs options on activation get to return stripped logs
as a convenience. (#445)
0f96fa4 is described below
commit 0f96fa458175849aef00caccdd46815eee750a93
Author: rodric rabbah <[email protected]>
AuthorDate: Sat Jun 29 10:18:23 2019 -0400
Add --logs options on activation get to return stripped logs as a
convenience. (#445)
---
commands/activation.go | 4 +++-
commands/flags.go | 1 +
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/commands/activation.go b/commands/activation.go
index 023eeb0..028c3a5 100644
--- a/commands/activation.go
+++ b/commands/activation.go
@@ -165,8 +165,9 @@ var activationGetCmd = &cobra.Command{
"status":
activation.Response.Status,
"time":
time.Unix(activation.End/1000, 0)}))
printJSON(activation.Response.Result)
+ } else if Flags.activation.logs {
+ printStrippedActivationLogs(activation.Logs)
} else {
-
if len(field) > 0 {
fmt.Fprintf(color.Output,
wski18n.T("{{.ok}} got activation
{{.id}}, displaying field {{.field}}\n",
@@ -456,6 +457,7 @@ func init() {
activationGetCmd.Flags().BoolVarP(&Flags.common.summary, "summary",
"s", false, wski18n.T("summarize activation details"))
activationGetCmd.Flags().BoolVarP(&Flags.activation.last, "last", "l",
false, wski18n.T("retrieves the last activation"))
+ activationGetCmd.Flags().BoolVarP(&Flags.activation.logs, "logs", "g",
false, wski18n.T("emit only the logs, stripped of time stamps and stream
identifier"))
activationLogsCmd.Flags().BoolVarP(&Flags.activation.last, "last", "l",
false, wski18n.T("retrieves the last activation"))
activationLogsCmd.Flags().BoolVarP(&Flags.activation.strip, "strip",
"r", false, wski18n.T("strip timestamp and stream information"))
diff --git a/commands/flags.go b/commands/flags.go
index 9f24f0a..25c9b96 100644
--- a/commands/flags.go
+++ b/commands/flags.go
@@ -101,6 +101,7 @@ type FlagsStruct struct {
exit int
last bool
strip bool
+ logs bool
}
// rule