Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --logs options on activation get to return stripped logs as a convenience #445

Merged
merged 1 commit into from Jun 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion commands/activation.go
Expand Up @@ -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",
Expand Down Expand Up @@ -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"))
Expand Down
1 change: 1 addition & 0 deletions commands/flags.go
Expand Up @@ -101,6 +101,7 @@ type FlagsStruct struct {
exit int
last bool
strip bool
logs bool
}

// rule
Expand Down