Skip to content

Commit

Permalink
chore(pkg/cmd): add examples to attach
Browse files Browse the repository at this point in the history
Signed-off-by: Lorenzo Fontana <lo@linux.com>
  • Loading branch information
fntlnz committed Apr 24, 2019
1 parent 6734ac5 commit 309afa5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 14 deletions.
18 changes: 10 additions & 8 deletions pkg/cmd/attach.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,19 @@ import (
)

var (
attachShort = `` // Wrap with i18n.T()
attachLong = attachShort + `
...`
attachShort = `Attach to an existing trace` // Wrap with i18n.T()
attachLong = attachShort

attachExamples = `
# ...
%[1]s trace attach -h
# Attach to a trace using its name
%[1]s trace attach kubectl-trace-d5842929-0b78-11e9-a9fa-40a3cc632df1
# Attach to a trace using its id
%[1]s trace attach 5594d7e1-0b78-11e9-b7f1-40a3cc632df1
# ...
%[1]s trace attach`
# Attach to a trace in a namespace using its name
%[1]s trace attach kubectl-trace-d5842929-0b78-11e9-a9fa-40a3cc632df1 -n mynamespace
`
)

// AttachOptions ...
Expand Down
3 changes: 1 addition & 2 deletions pkg/cmd/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ import (

var (
deleteShort = `Delete a bpftrace program execution` // Wrap with i18n.T()
deleteLong = `
...`
deleteLong = deleteShort

deleteExamples = `
# Delete a specific bpftrace program by ID
Expand Down
6 changes: 2 additions & 4 deletions pkg/cmd/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import (
"github.com/iovisor/kubectl-trace/pkg/meta"
"github.com/iovisor/kubectl-trace/pkg/tracejob"
"github.com/spf13/cobra"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/util/duration"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

"k8s.io/cli-runtime/pkg/genericclioptions"
batchv1client "k8s.io/client-go/kubernetes/typed/batch/v1"
Expand All @@ -23,9 +23,7 @@ import (
var (
getCommand = "get"
getShort = `Get the running traces` // Wrap with i18n.T()
getLong = getShort + `
...`
getLong = getShort

getExamples = `
# Get all traces in a namespace
Expand Down

0 comments on commit 309afa5

Please sign in to comment.