From 1340d997e8bb9108f4ebf3a0d3363b2548ab65ce Mon Sep 17 00:00:00 2001 From: lbonanomi <5369016+lbonanomi@users.noreply.github.com> Date: Wed, 22 Jul 2020 16:05:32 -0400 Subject: [PATCH 1/3] Update main.go --- cmd/sops/main.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cmd/sops/main.go b/cmd/sops/main.go index ee03072c3..780e1343c 100644 --- a/cmd/sops/main.go +++ b/cmd/sops/main.go @@ -184,6 +184,10 @@ func main() { Name: "user", Usage: "the user to run the command as", }, + cli.StringFlag{ + Name: "input-type", + Usage: "currently json, yaml, dotenv and binary are supported. If not set, sops will use the file's extension to determine the type", + }, }, keyserviceFlags...), Action: func(c *cli.Context) error { if len(c.Args()) != 2 { @@ -966,8 +970,9 @@ func inputStore(context *cli.Context, path string) common.Store { return common.DefaultStoreForPathOrFormat(path, context.String("input-type")) } +// SCARY! SHOULD THIS BE USING INPUT-TYPE? func outputStore(context *cli.Context, path string) common.Store { - return common.DefaultStoreForPathOrFormat(path, context.String("output-type")) + return common.DefaultStoreForPathOrFormat(path, context.String("input-type")) } func parseTreePath(arg string) ([]interface{}, error) { From e318cc02644f3db9fadf13dc1abb9a711fd90745 Mon Sep 17 00:00:00 2001 From: lbonanomi <5369016+lbonanomi@users.noreply.github.com> Date: Fri, 24 Jul 2020 14:09:33 -0400 Subject: [PATCH 2/3] Update main.go --- cmd/sops/main.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cmd/sops/main.go b/cmd/sops/main.go index 780e1343c..fa0b3d363 100644 --- a/cmd/sops/main.go +++ b/cmd/sops/main.go @@ -188,6 +188,10 @@ func main() { Name: "input-type", Usage: "currently json, yaml, dotenv and binary are supported. If not set, sops will use the file's extension to determine the type", }, + cli.StringFlag{ + Name: "output-type", + Usage: "currently json, yaml, dotenv and binary are supported. If not set, sops will use the binary output format", + }, }, keyserviceFlags...), Action: func(c *cli.Context) error { if len(c.Args()) != 2 { @@ -970,9 +974,8 @@ func inputStore(context *cli.Context, path string) common.Store { return common.DefaultStoreForPathOrFormat(path, context.String("input-type")) } -// SCARY! SHOULD THIS BE USING INPUT-TYPE? func outputStore(context *cli.Context, path string) common.Store { - return common.DefaultStoreForPathOrFormat(path, context.String("input-type")) + return common.DefaultStoreForPathOrFormat(path, context.String("output-type")) } func parseTreePath(arg string) ([]interface{}, error) { From da417862f1bca8105433df1de59db0763bae18f7 Mon Sep 17 00:00:00 2001 From: lbonanomi <5369016+lbonanomi@users.noreply.github.com> Date: Fri, 24 Jul 2020 15:16:48 -0400 Subject: [PATCH 3/3] Update cmd/sops/main.go Co-authored-by: Adrian Utrilla --- cmd/sops/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/sops/main.go b/cmd/sops/main.go index fa0b3d363..6a550d2cd 100644 --- a/cmd/sops/main.go +++ b/cmd/sops/main.go @@ -190,7 +190,7 @@ func main() { }, cli.StringFlag{ Name: "output-type", - Usage: "currently json, yaml, dotenv and binary are supported. If not set, sops will use the binary output format", + Usage: "currently json, yaml, dotenv and binary are supported. If not set, sops will use the input file's extension to determine the output format", }, }, keyserviceFlags...), Action: func(c *cli.Context) error {