Skip to content

Commit f40a19b

Browse files
icloudnotetekton-robot
authored andcommitted
refactor(logs): 将display-name参数重命名为long
参数名称更改为long以更清晰地表示其功能,同时保持原有行为不变
1 parent 025ac7b commit f40a19b

4 files changed

Lines changed: 8 additions & 8 deletions

File tree

docs/cmd/tkn_pipelinerun_logs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ Show the logs of PipelineRun named 'microservice-1' for all Tasks and steps (inc
3131

3232
```
3333
-a, --all show all logs including init steps injected by tekton
34-
--display-name show logs with task display name (display name and step name)
3534
-E, --exit-with-pipelinerun-error exit with pipelinerun to the unix shell, 0 if success, 1 if error, 2 on unknown status
3635
-f, --follow stream live logs
3736
-F, --fzf use fzf to select a PipelineRun
3837
-h, --help help for logs
3938
-L, --last show logs for last PipelineRun
4039
--limit int lists number of PipelineRuns (default 5)
40+
--long show logs with task display name (display name and step name)
4141
--prefix prefix each log line with the log source (task name and step name) (default true)
4242
-t, --task strings show logs for mentioned Tasks only
4343
--timestamps show logs with timestamp

docs/man/man1/tkn-pipelinerun-logs.1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@ Show the logs of a PipelineRun
2323
\fB\-a\fP, \fB\-\-all\fP[=false]
2424
show all logs including init steps injected by tekton
2525

26-
.PP
27-
\fB\-\-display\-name\fP[=false]
28-
show logs with task display name (display name and step name)
29-
3026
.PP
3127
\fB\-E\fP, \fB\-\-exit\-with\-pipelinerun\-error\fP[=false]
3228
exit with pipelinerun to the unix shell, 0 if success, 1 if error, 2 on unknown status
@@ -51,6 +47,10 @@ Show the logs of a PipelineRun
5147
\fB\-\-limit\fP=5
5248
lists number of PipelineRuns
5349

50+
.PP
51+
\fB\-\-long\fP[=false]
52+
show logs with task display name (display name and step name)
53+
5454
.PP
5555
\fB\-\-prefix\fP[=true]
5656
prefix each log line with the log source (task name and step name)

pkg/cmd/pipelinerun/logs.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ Show the logs of PipelineRun named 'microservice-1' for all Tasks and steps (inc
8484
c.Flags().BoolVarP(&opts.Follow, "follow", "f", false, "stream live logs")
8585
c.Flags().BoolVarP(&opts.Timestamps, "timestamps", "", false, "show logs with timestamp")
8686
c.Flags().BoolVarP(&opts.Prefixing, "prefix", "", true, "prefix each log line with the log source (task name and step name)")
87-
c.Flags().BoolVarP(&opts.DisplayName, "display-name", "", false, "show logs with task display name (display name and step name)")
87+
c.Flags().BoolVarP(&opts.Long, "long", "", false, "show logs with task display name (display name and step name)")
8888
c.Flags().BoolVarP(&opts.ExitWithPrError, "exit-with-pipelinerun-error", "E", false, "exit with pipelinerun to the unix shell, 0 if success, 1 if error, 2 on unknown status")
8989
c.Flags().StringSliceVarP(&opts.Tasks, "task", "t", []string{}, "show logs for mentioned Tasks only")
9090
c.Flags().IntVarP(&opts.Limit, "limit", "", defaultLimit, "lists number of PipelineRuns")
@@ -111,7 +111,7 @@ func Run(opts *options.LogOptions) error {
111111
return err
112112
}
113113

114-
log.NewWriter(log.LogTypePipeline, opts.Prefixing).WithDisplayName(opts.DisplayName).Write(opts.Stream, logC, errC)
114+
log.NewWriter(log.LogTypePipeline, opts.Prefixing).WithDisplayName(opts.Long).Write(opts.Stream, logC, errC)
115115

116116
// get pipelinerun status
117117
if opts.ExitWithPrError {

pkg/options/logs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ type LogOptions struct {
5050
Tail int64
5151
Timestamps bool
5252
Prefixing bool
53-
DisplayName bool
53+
Long bool
5454
ExitWithPrError bool
5555
// ActivityTimeout is the amount of time to wait for some activity
5656
// (e.g. Pod ready) before giving up.

0 commit comments

Comments
 (0)