Skip to content

Commit a217157

Browse files
committed
alpha: logs with args as targets
1 parent 49bd8eb commit a217157

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

cmd/logs.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ func (e *Executor) newLogsCmd() *cobra.Command {
3434
opts := &actions.LogsOptions{}
3535

3636
var (
37-
target []string
37+
targets []string
3838
severity string
3939
start, end string
4040
)
@@ -52,7 +52,9 @@ func (e *Executor) newLogsCmd() *cobra.Command {
5252
RunE: func(cmd *cobra.Command, args []string) error {
5353
opts.Targets = util.NewTargetMatcher()
5454

55-
for _, t := range target {
55+
targets = append(targets, args...)
56+
57+
for _, t := range targets {
5658
err := opts.Targets.Add(t)
5759
if err != nil {
5860
return err
@@ -100,7 +102,7 @@ func (e *Executor) newLogsCmd() *cobra.Command {
100102
}
101103

102104
f := cmd.Flags()
103-
f.StringSliceVarP(&target, "target", "t", nil, "target only specified apps or dependencies, can specify multiple or separate values with comma in a form of <app type>.<name> or dep.<dep name>, e.g.: static.website,service.api,dep.database")
105+
f.StringSliceVarP(&targets, "target", "t", nil, "target only specified apps or dependencies, can specify multiple or separate values with comma in a form of <app type>.<name> or dep.<dep name>, e.g.: static.website,service.api,dep.database")
104106
f.BoolVarP(&opts.OnlyApps, "only-apps", "a", false, "target only apps, skip all dependencies")
105107
f.StringVarP(&start, "start", "s", "5m", "start time")
106108
f.StringVarP(&end, "end", "d", "", "end time")

0 commit comments

Comments
 (0)