From ab316d22509ed6e601773a7ef66c0131aa8af24b Mon Sep 17 00:00:00 2001 From: Forest Johnson Date: Wed, 24 Nov 2021 16:01:38 +0000 Subject: Fix broken defaults and broken flags (#314) * start with a default config, not an empty config. * some data structures were present on Empty config but not Default config * the monkey patched CLIContext is working * remove print debugging log * make the behaviour of the flags consistent across all data types Conflicts: internal/config/config.go * try to fix accidentally broken test --- cmd/gotosocial/admincommands.go | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'cmd/gotosocial/admincommands.go') diff --git a/cmd/gotosocial/admincommands.go b/cmd/gotosocial/admincommands.go index 5d505fe77..a70693b2c 100644 --- a/cmd/gotosocial/admincommands.go +++ b/cmd/gotosocial/admincommands.go @@ -25,7 +25,7 @@ import ( "github.com/urfave/cli/v2" ) -func adminCommands() []*cli.Command { +func adminCommands(allFlags []cli.Flag) []*cli.Command { return []*cli.Command{ { Name: "admin", @@ -56,7 +56,7 @@ func adminCommands() []*cli.Command { }, }, Action: func(c *cli.Context) error { - return runAction(c, account.Create) + return runAction(c, allFlags, account.Create) }, }, { @@ -70,7 +70,7 @@ func adminCommands() []*cli.Command { }, }, Action: func(c *cli.Context) error { - return runAction(c, account.Confirm) + return runAction(c, allFlags, account.Confirm) }, }, { @@ -84,7 +84,7 @@ func adminCommands() []*cli.Command { }, }, Action: func(c *cli.Context) error { - return runAction(c, account.Promote) + return runAction(c, allFlags, account.Promote) }, }, { @@ -98,7 +98,7 @@ func adminCommands() []*cli.Command { }, }, Action: func(c *cli.Context) error { - return runAction(c, account.Demote) + return runAction(c, allFlags, account.Demote) }, }, { @@ -112,7 +112,7 @@ func adminCommands() []*cli.Command { }, }, Action: func(c *cli.Context) error { - return runAction(c, account.Disable) + return runAction(c, allFlags, account.Disable) }, }, { @@ -126,7 +126,7 @@ func adminCommands() []*cli.Command { }, }, Action: func(c *cli.Context) error { - return runAction(c, account.Suspend) + return runAction(c, allFlags, account.Suspend) }, }, { @@ -145,7 +145,7 @@ func adminCommands() []*cli.Command { }, }, Action: func(c *cli.Context) error { - return runAction(c, account.Password) + return runAction(c, allFlags, account.Password) }, }, }, @@ -161,7 +161,7 @@ func adminCommands() []*cli.Command { }, }, Action: func(c *cli.Context) error { - return runAction(c, trans.Export) + return runAction(c, allFlags, trans.Export) }, }, { @@ -175,7 +175,7 @@ func adminCommands() []*cli.Command { }, }, Action: func(c *cli.Context) error { - return runAction(c, trans.Import) + return runAction(c, allFlags, trans.Import) }, }, }, -- cgit v1.2.3