Skip to content

Commit 3f84cdd

Browse files
authored
Merge pull request #41 from runlevel5/patch-2
2 parents 8976ff6 + 8c1e88f commit 3f84cdd

2 files changed

Lines changed: 12 additions & 6 deletions

File tree

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ $ cat secrets.ejson
3636
}
3737
```
3838

39+
> [!NOTE]
40+
> If either of the `AWS_REGION` or `AWS_DEFAULT_REGION` environment variables is set, it will be used implicitly for `--aws-region` when the flag is not provided.
41+
3942
Encrypting:
4043

4144
```

cmd/ejsonkms/main.go

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,9 @@ func main() {
4343
Usage: "print output to the provided file, rather than stdout",
4444
},
4545
cli.StringFlag{
46-
Name: "aws-region",
47-
Usage: "AWS Region",
46+
Name: "aws-region",
47+
Usage: "AWS Region",
48+
EnvVar: "AWS_REGION,AWS_DEFAULT_REGION",
4849
},
4950
},
5051
Action: func(c *cli.Context) {
@@ -63,8 +64,9 @@ func main() {
6364
Usage: "KMS Key ID to encrypt the private key with",
6465
},
6566
cli.StringFlag{
66-
Name: "aws-region",
67-
Usage: "AWS Region",
67+
Name: "aws-region",
68+
Usage: "AWS Region",
69+
EnvVar: "AWS_REGION,AWS_DEFAULT_REGION",
6870
},
6971
cli.StringFlag{
7072
Name: "o",
@@ -87,8 +89,9 @@ func main() {
8789
Usage: "Suppress export statement",
8890
},
8991
cli.StringFlag{
90-
Name: "aws-region",
91-
Usage: "AWS Region",
92+
Name: "aws-region",
93+
Usage: "AWS Region",
94+
EnvVar: "AWS_REGION,AWS_DEFAULT_REGION",
9295
},
9396
},
9497
Action: func(c *cli.Context) {

0 commit comments

Comments
 (0)