Skip to content

Commit e2e9bc5

Browse files
inessebzldesauw
authored andcommitted
chore: add use examples for secrets commands (#111)
1 parent 1986071 commit e2e9bc5

File tree

2 files changed

+16
-14
lines changed

2 files changed

+16
-14
lines changed

cmd/okms/secrets/secrets.go

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,10 @@ func kvPutCmd() *cobra.Command {
6464
)
6565

6666
cmd := &cobra.Command{
67-
Use: "put PATH [DATA]",
68-
Short: "Writes the data to the given path in the key-value store. (DATA format: bar=baz)",
69-
Args: cobra.MinimumNArgs(2),
67+
Use: "put PATH DATA...",
68+
Short: "Writes the data to the given path in the key-value store. (DATA format: bar=baz [email protected])",
69+
Args: cobra.MinimumNArgs(2),
70+
Example: "put foo/bar zip=zap [email protected] | put foo/bar @data.json",
7071
Run: func(cmd *cobra.Command, args []string) {
7172
in := io.Reader(os.Stdin)
7273

@@ -108,9 +109,10 @@ func kvPatchCmd() *cobra.Command {
108109
)
109110

110111
cmd := &cobra.Command{
111-
Use: "patch PATH [DATA]",
112-
Short: "Writes the data to the given path in the key-value store. (DATA format: bar=baz)",
113-
Args: cobra.MinimumNArgs(2),
112+
Use: "patch PATH DATA...",
113+
Short: "Writes the data to the given path in the key-value store. (DATA format: bar=baz [email protected])",
114+
Args: cobra.MinimumNArgs(2),
115+
Example: "patch foo/bar zip=zap [email protected] | patch foo/bar @data.json",
114116
Run: func(cmd *cobra.Command, args []string) {
115117
in := io.Reader(os.Stdin)
116118

cmd/okms/secretsV2/secrets.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ import (
1616
)
1717

1818
func secretListCmd() *cobra.Command {
19-
// TODO: Fix
20-
// It generate a 500 in the CCM currently
2119
var (
2220
page_size uint32
2321
page_number uint32
@@ -53,9 +51,10 @@ func secretPostCmd() *cobra.Command {
5351
customMetadata map[string]string
5452
)
5553
cmd := &cobra.Command{
56-
Use: "create PATH [DATA]",
57-
Short: "Create a secret",
58-
Args: cobra.MinimumNArgs(2),
54+
Use: "create PATH DATA...",
55+
Short: "Create a secret. Data is in key value format, a json file can also be used by adding the prefix '@' (exp: bar=baz [email protected])",
56+
Args: cobra.MinimumNArgs(2),
57+
Example: "create foo/bar zip=zap [email protected] | create foo/bar @data.json",
5958
Run: func(cmd *cobra.Command, args []string) {
6059
in := io.Reader(os.Stdin)
6160
body := types.PostSecretV2Request{
@@ -144,9 +143,10 @@ func secretPutCmd() *cobra.Command {
144143
customMetadata map[string]string
145144
)
146145
cmd := &cobra.Command{
147-
Use: "update PATH [DATA]",
148-
Short: "Update a secret",
149-
Args: cobra.MinimumNArgs(1),
146+
Use: "update PATH [DATA]...",
147+
Short: "Update a secret",
148+
Args: cobra.MinimumNArgs(1),
149+
Example: "update foo/bar zip=zap [email protected] | update --cas-required foo/bar @data.json",
150150
Run: func(cmd *cobra.Command, args []string) {
151151
in := io.Reader(os.Stdin)
152152
body := types.PutSecretV2Request{

0 commit comments

Comments
 (0)