add diff mode to init

Signed-off-by: Christian Richter <crichter@owncloud.com>
This commit is contained in:
Christian Richter
2024-07-26 07:49:37 +02:00
parent 24b940dfcc
commit e2c4586706
3 changed files with 363 additions and 270 deletions
+7 -1
View File
@@ -26,6 +26,12 @@ func InitCommand(cfg *config.Config) *cli.Command {
Value: "ask",
Usage: "Allow insecure oCIS config",
},
&cli.BoolFlag{
Name: "diff",
Aliases: []string{"d"},
Usage: "Show the difference between the current config and the new one",
Value: false,
},
&cli.BoolFlag{
Name: "force-overwrite",
Aliases: []string{"f"},
@@ -57,7 +63,7 @@ func InitCommand(cfg *config.Config) *cli.Command {
} else if insecureFlag == strings.ToLower("true") || insecureFlag == strings.ToLower("yes") || insecureFlag == strings.ToLower("y") {
insecure = true
}
err := ocisinit.CreateConfig(insecure, c.Bool("force-overwrite"), c.String("config-path"), c.String("admin-password"))
err := ocisinit.CreateConfig(insecure, c.Bool("force-overwrite"), c.Bool("diff"), c.String("config-path"), c.String("admin-password"))
if err != nil {
log.Fatalf("Could not create config: %s", err)
}