Skip to content

Commit b91e59f

Browse files
committed
Rename prefix option to filter
It also includes the description of each option
1 parent bcf5636 commit b91e59f

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

main.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ var (
3030
type Options struct {
3131
Provider string
3232
Project string
33-
Prefix string
33+
Filter string
3434
Parser string
3535
Template string
3636
Output string
@@ -39,13 +39,13 @@ type Options struct {
3939
func main() {
4040
options := &Options{}
4141

42-
flag.StringVar(&options.Provider, "provider", "gcp", "")
43-
flag.StringVar(&options.Project, "project", "", "")
44-
flag.StringVar(&options.Prefix, "secret-prefix", "", "")
45-
flag.StringVar(&options.Parser, "secret-data-parser", "plaintext", "")
46-
flag.StringVar(&options.Template, "template", "", "")
47-
flag.StringVar(&options.Output, "output", "", "")
48-
v := flag.Bool("version", false, "")
42+
flag.StringVar(&options.Provider, "provider", "gcp", "name of the provider that manages the secrets")
43+
flag.StringVar(&options.Project, "project", "", "gcp project that contains the secrets")
44+
flag.StringVar(&options.Filter, "filter", "", "regex to filter secrets by name")
45+
flag.StringVar(&options.Parser, "data-parser", "plaintext", "parse secret based on data type")
46+
flag.StringVar(&options.Template, "template", "", "template to render secret data")
47+
flag.StringVar(&options.Output, "output", "", "path to write output file to")
48+
v := flag.Bool("version", false, "show the current secrets-init version")
4949

5050
flag.Parse()
5151

provider_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ func TestFilter(t *testing.T) {
2828
`^myapp*|^xxx*`,
2929
false,
3030
},
31+
{
32+
"app_password",
33+
``,
34+
true,
35+
},
3136
}
3237

3338
gcp := &GCPSecretManager{}

runner.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func Run(options *Options) error {
3636
return err
3737
}
3838

39-
data, err := provider.ListSecrets(options.Project, options.Prefix)
39+
data, err := provider.ListSecrets(options.Project, options.Filter)
4040
if err != nil {
4141
return err
4242
}

0 commit comments

Comments
 (0)