Skip to content

Commit

Permalink
add example help output
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobbednarz committed Sep 16, 2020
1 parent df94c80 commit 66c6a90
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ var addCmd = &cobra.Command{
Use: "add [profile]",
Short: "Add a new profile to your configuration and keychain",
Long: "",
Example: `
Add a new profile (you will be prompted for credentials)
$ cf-vault add example-profile
`,
Args: func(cmd *cobra.Command, args []string) error {
if len(args) < 1 {
return errors.New("requires a profile argument")
Expand Down
16 changes: 16 additions & 0 deletions cmd/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,22 @@ var execCmd = &cobra.Command{
Use: "exec [profile]",
Short: "Execute a command with Cloudflare credentials populated",
Long: "",
Example: `
Execute a single command with credentials populated
$ cf-vault exec example-profile -- env | grep -i cloudflare
CLOUDFLARE_VAULT_SESSION=example-profile
[email protected]
CLOUDFLARE_API_KEY=s3cr3t
Spawn a new shell with credentials populated
$ cf-vault exec example-profile --
$ env | grep -i cloudflare
CLOUDFLARE_VAULT_SESSION=example-profile
[email protected]
CLOUDFLARE_API_KEY=s3cr3t
`,
Args: func(cmd *cobra.Command, args []string) error {
if len(args) < 1 {
return errors.New("requires a profile argument")
Expand Down

0 comments on commit 66c6a90

Please sign in to comment.