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

chore(pkg/cmd): add examples to attach #71

Merged
merged 1 commit into from
Apr 24, 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤗

`
)

// 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