From 309afa59d0575f149074a70b42171290573e5f39 Mon Sep 17 00:00:00 2001 From: Lorenzo Fontana Date: Wed, 24 Apr 2019 02:11:25 +0200 Subject: [PATCH] chore(pkg/cmd): add examples to attach Signed-off-by: Lorenzo Fontana --- pkg/cmd/attach.go | 18 ++++++++++-------- pkg/cmd/delete.go | 3 +-- pkg/cmd/get.go | 6 ++---- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/pkg/cmd/attach.go b/pkg/cmd/attach.go index 6031106b..e76ef4c2 100644 --- a/pkg/cmd/attach.go +++ b/pkg/cmd/attach.go @@ -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 ... diff --git a/pkg/cmd/delete.go b/pkg/cmd/delete.go index 0e6f3211..e15596db 100644 --- a/pkg/cmd/delete.go +++ b/pkg/cmd/delete.go @@ -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 diff --git a/pkg/cmd/get.go b/pkg/cmd/get.go index af276481..6db6218e 100644 --- a/pkg/cmd/get.go +++ b/pkg/cmd/get.go @@ -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" @@ -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