44 "fmt"
55 "net/url"
66
7- errors "github.com/hashicorp/errwrap "
7+ "github.com/ansel1/merry "
88 "github.com/mikesimons/envelope"
99 "gopkg.in/urfave/cli.v1"
1010)
@@ -13,8 +13,10 @@ import (
1313// e.g $ envelope add-key test kms://arn
1414func addKeyCommand () cli.Command {
1515 return cli.Command {
16- Name : "add-key" ,
17- Usage : "Add a key to the keyring" ,
16+ Name : "addkey" ,
17+ Usage : "Add a key to the keyring." ,
18+ Description : `Master key DSN is of the form <provider>://<dsn>. The only supported provider is currently awskms.
19+ Example: envelope add-key mytestkey awskms://arn:aws:kms:us-east-1:111111111111:key/abcdef01-2345-6789-abcd-ef0123456789` ,
1820 ArgsUsage : "<alias> <master key dsn>" ,
1921 Flags : []cli.Flag {
2022 cli.StringFlag {
@@ -24,7 +26,7 @@ func addKeyCommand() cli.Command {
2426 },
2527 Action : func (c * cli.Context ) error {
2628 if c .NArg () != 2 {
27- cli .ShowCommandHelp (c , "add-key " )
29+ cli .ShowCommandHelp (c , "addkey " )
2830 fmt .Println ("" )
2931 return cli .NewExitError ("Error: Not enough arguments" , 1 )
3032 }
@@ -61,7 +63,7 @@ func parseEncryptionContext(input string) (map[string]string, error) {
6163
6264 values , err := url .ParseQuery (input )
6365 if err != nil {
64- return nil , errors . Wrapf ( "Unable to parse encryption context" , err )
66+ return nil , merry . Wrap ( err ). WithMessage ( "Unable to parse encryption context" )
6567 }
6668
6769 output := make (map [string ]string )
0 commit comments