Skip to content

Commit 309afa5

Browse files
committed
chore(pkg/cmd): add examples to attach
Signed-off-by: Lorenzo Fontana <[email protected]>
1 parent 6734ac5 commit 309afa5

File tree

3 files changed

+13
-14
lines changed

3 files changed

+13
-14
lines changed

pkg/cmd/attach.go

+10-8
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,19 @@ import (
1818
)
1919

2020
var (
21-
attachShort = `` // Wrap with i18n.T()
22-
attachLong = attachShort + `
23-
24-
...`
21+
attachShort = `Attach to an existing trace` // Wrap with i18n.T()
22+
attachLong = attachShort
2523

2624
attachExamples = `
27-
# ...
28-
%[1]s trace attach -h
25+
# Attach to a trace using its name
26+
%[1]s trace attach kubectl-trace-d5842929-0b78-11e9-a9fa-40a3cc632df1
27+
28+
# Attach to a trace using its id
29+
%[1]s trace attach 5594d7e1-0b78-11e9-b7f1-40a3cc632df1
2930
30-
# ...
31-
%[1]s trace attach`
31+
# Attach to a trace in a namespace using its name
32+
%[1]s trace attach kubectl-trace-d5842929-0b78-11e9-a9fa-40a3cc632df1 -n mynamespace
33+
`
3234
)
3335

3436
// AttachOptions ...

pkg/cmd/delete.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ import (
1616

1717
var (
1818
deleteShort = `Delete a bpftrace program execution` // Wrap with i18n.T()
19-
deleteLong = `
20-
...`
19+
deleteLong = deleteShort
2120

2221
deleteExamples = `
2322
# Delete a specific bpftrace program by ID

pkg/cmd/get.go

+2-4
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ import (
1010
"github.com/iovisor/kubectl-trace/pkg/meta"
1111
"github.com/iovisor/kubectl-trace/pkg/tracejob"
1212
"github.com/spf13/cobra"
13+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
1314
"k8s.io/apimachinery/pkg/types"
1415
"k8s.io/apimachinery/pkg/util/duration"
15-
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
1616

1717
"k8s.io/cli-runtime/pkg/genericclioptions"
1818
batchv1client "k8s.io/client-go/kubernetes/typed/batch/v1"
@@ -23,9 +23,7 @@ import (
2323
var (
2424
getCommand = "get"
2525
getShort = `Get the running traces` // Wrap with i18n.T()
26-
getLong = getShort + `
27-
28-
...`
26+
getLong = getShort
2927

3028
getExamples = `
3129
# Get all traces in a namespace

0 commit comments

Comments
 (0)